I have done this code,
if (k == 21 && click1 == true)
{
for (k = 21; k < 39; k++) {
Spinner sp = (Spinner) gridLayout.getChildAt(k);
String value = (String) sp.getSelectedItem();
Log.d("Spinner value als string", value);
if (!value.isEmpty()) {
value1 = Integer.parseInt(value);
("Spinner value als invert", ""+ value1);
sum = sum + value1;
Log.d("Totall Value", "" + sum);
}
}
}
Here the value k has been updated as 39 after iteration and i want use this value to a variable as 39 so that next this loop doesn't start again and I can use this to another loop or iteration. Help needed !!