I'm trying to get my spinner working as the Action Bar Drop Down List item, but I cant seem to implement it at all, there aren't many tutorials for this after searching through Google. I think its something to do with the .setListNavigationCallbacks(); line of code, I just have no idea how to get this working from that line onwards.
// setup action bar for spinner
ActionBar bar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
bar.setListNavigationCallbacks();
Spinner spinner = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.tools_array_stopwatch, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);
}
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
switch (arg2) {
case 0:
break;
case 1:
Intent countdown = new Intent(this, CountdownActivity.class);
startActivity(countdown);
break;
default :
break;
}
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}