I was fooling around with Android and my Java knowledge is limited at best (for instance, I\'m perplexed by the fact that it allows inline classes!?).
My question is as
Use the view
parameter of onItemSelected
to decide which Spinner sent the onItemSelected
event. From this doing the logic is simple.
Make spinner1 2 and 3 member of the class (activity)
private Spinner spinner1;
Then simply compare the view
param against
if (view==this.spinner1) {
// event came from spinner 1
// create a new adapter, assign the new adapter to spinner 2
} else if (view==this.spinner2) {
// event came from spinner 2
}
Try to use this :
switch(parent.getId())
{
case R.id.spinner1:
Log.d(TAG,"spinner1");
break;
case R.id.spinner2:
Log.d(TAG,"spinner2");
break;
}
good luck !