I have this spinner with a list of music items. Upon clicking the music items, music will play and stop when user selects any music items.
The question is how to stop the music if user presses the back button?
I have tried to find methods that is called when spinner is closed. Can't seem to find any though. Am I missing anything obvious?
Please help!! thanks
If it matters, my spinner is called from a fragment.
musicSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> av, View v, int i, long l) {
Log.v("music spinner","Item selected");
if (mp.isPlaying())
mp.stop();
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
Log.v("music spinner","Item not selected");
}
});