The spinner has an array list of band genres when selecting any of the genres in the spinner it will display a toast, the toast isn't showing when clicking the spinner, the code isn't showing any errors ? any ideas why ?
String spinnerSelection = null;
Spinner spinner = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_main );
ArrayAdapter<String> adapter = new ArrayAdapter<>(
this, android.R.layout.simple_spinner_item, spinnerContent);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner = (Spinner) findViewById(R.id.spinner);
spinner.setAdapter(adapter);
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
public void onItemSelected(AdapterView<?>parent, View v, int position, long id) {
{
Toast.makeText( getBaseContext(),"Hell Yeah", Toast.LENGTH_SHORT).show();
}
}
public void onNothingSelected(AdapterView<?> arg0) {
}
}