i know this is sth really easy to do for many of you, but i have been trying all the answers here and everywhere else... none of them worked ..to me.. maybe you can help with this..? i have an ArrayList (keys) ... and i want to increment the index at each call... with a button.. i want the first out put to be: "key" : 0, then, pressing the button again and:"key" : 1, and again "key" : 2. Thank you in advance!! I did this:
for (int i = 0; i < keys.size(); i++) {
if (like) {
Log.i("key", keys.get(i));
keys.set(i, keys.get(i) + 1);
}
}