Reputation: 116
I have four spinners on Android.
The better way to explain the work of the spinners is this site.
On the left side of the browser, there are four dropdown menus and I want the same build implemented on an Android app, but when one spinner changes it's affecting the other!
spSura.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
{
browse.changeSura();
}
public void onNothingSelected(AdapterView<?> parent) {}
The code above is part of my code and it shows which listener I use.
Upvotes: 1
Views: 73
Reputation: 4199
Your question is not clear for me it's better if you share the full code of the problem. I think you're not able to differentiate between the spinners so add individual id's for each spinner and try to track the change on each of them and give different action as follows
if(view.getId()){
case R.id.spinners_1:
// change spinners 1
break;
case case R.id.spinners_2:
// change spinners 2
break;
}
Upvotes: 1