How can you set the event listener for a Spinner when the selected item changes?
Basically what I am trying to do is something similar to this:
spinn
You can implement AdapterView.OnItemSelectedListener
class in your Activity.
And then use the below line within onCreate()
Spinner spin = (Spinner) findViewById(R.id.spinner);
spin.setOnItemSelectedListener(this);
Then override these two methods:
public void onItemSelected(AdapterView> parent, View v, int position, long id) {
selection.setText(items[position]);
}
public void onNothingSelected(AdapterView> parent) {
selection.setText("");
}