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 want to create app using your spinner in this app i want to show item title but i want to get two value id and title (item name) when i click on spinner item.
so please tell me how can i set custom ID and Title With Array List and get access it on click event.
The text was updated successfully, but these errors were encountered:
Hi, I think I have a better solution for you
Declare two variables:
ArrayList ids;
ArrayList labels;
And then the object variable list
List suppliers;
for (Supplier supplier : suppliers) {
ids.add(supplier.getId().toString());
labels.add(supplier.getCompanyName());
}
spdItems.bindOnSpinerListener(new OnSpinerItemClick() { @OverRide
public void onClick(String item, int position) {
//TO get id use the position
String id = ids.get(position);
String label = lables.get(position);
}
});
Hello Md Farhan,
I want to create app using your spinner in this app i want to show item title but i want to get two value id and title (item name) when i click on spinner item.
so please tell me how can i set custom ID and Title With Array List and get access it on click event.
The text was updated successfully, but these errors were encountered: