I\'ve a rest response as below, and i need to populate the output to spinner. I\'ve been successfully pass the \"name\" to spinner and it\'s works. But I also need get the \"id\
Try this
To get ID :
provinceResponseData.get(spinner.getSelectedItemPosition()).getId();
Add spinner listener :
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
// call the service and pass the parameter
serviceCall(provinceResponseData.get(spinner.getSelectedItemPosition()).getId());
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
// your code here
}
});