You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to pass a info contained on the item (like price) to a new activity when press the Request button, so i need get first the info using something like "items.get(i).getBoxID()" the problem is when i do
for(int i = 0; i< items.size(); i++) {
final ArrayList idboxes = new ArrayList<>();
final int finalI = i;
items.get(i).setRequestBtnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), "CUSTOM HANDLER FOR FIRST BUTTON", Toast.LENGTH_SHORT).show();
System.out.println(items.get(i).getBoxID());
}
});
}
on the println there is a error with the i variable the code need to be final but that doesn't do what i need
any idea?
The text was updated successfully, but these errors were encountered:
Thomas the proyec was 1 year ago and I dont remember all :/ but he solutión was quite simple, on item of each element I store the listeners.
The item have all the info, so you can use that as a guide.
the code on the first comment its de solution i found
sorry for my english
I'm trying to pass a info contained on the item (like price) to a new activity when press the Request button, so i need get first the info using something like "items.get(i).getBoxID()" the problem is when i do
for(int i = 0; i< items.size(); i++) {
final ArrayList idboxes = new ArrayList<>();
final int finalI = i;
items.get(i).setRequestBtnClickListener(new View.OnClickListener() {
}
on the println there is a error with the i variable the code need to be final but that doesn't do what i need
any idea?
The text was updated successfully, but these errors were encountered: