Reputation: 3
Spinner Spte1;
String[] path1 ={"Celsius", "Kelvin","Farenheit"};
Spinner Spte2;
String[] path2 ={"Celsius","Kelvin","Farenheit"};
EditText ETTE1;
EditText ETTE2;
now the second code
Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
int position1 = Spte1.getSelectedItemPosition();
switch (position1){
case 0:
break;
case 1:
break;
case 2:
break ;
}
}
but i need to make code to chose between first item in first spinner and connected with second spinner and ad number in first text then the resuslt in the second text i need the code alowe me to make this action appreciate .
Upvotes: 0
Views: 247
Reputation: 8978
You need something like this:
switch(parent.getId()) {
case R.id.listview1:
// do something for the 1st spinner
break;
case R.id.listview2:
break;
// do something for the 2nd spinner
}
Upvotes: 1