Android: How To Get Value From Spinner, And Based On Value To Redirect To Another Page
I am new to android. I am stuck with the spinner. There are two spinner item 'FROM' and 'TO'. I want to code as..if I want to search FROM Place1, To Place2. Then after clicking but
Solution 1:
use this one
spinner.setOnItemSelectedListener(newSpinner.OnItemSelectedListener() {
@OverridepublicvoidonItemSelected(AdapterView<?> main, View view, int position,
long Id) {
if(position==0){
//your code
}
if(position==1){
//your code
}
}
}
Solution 2:
use this-
if(str1.equals("plot16")&&str2.equals("plot17")){
//do functionality
}
Post a Comment for "Android: How To Get Value From Spinner, And Based On Value To Redirect To Another Page"