How to retrieve position of an element from a custom adapter based on element name.. I have a cityAdapter that contains city name and id in key value format. I am trying to retrieve position by the following code
SpinnerModel model=new SpinnerModel();
model.setKey(""+currentLocation);
model.setValue(currentLocationValue);
int position = cityAdapter.getPosition(model);
Position is returning as -1. Can any one please guide me how to solve the issue.