ustawić naClickListener dla elementu spinner?
Mam spinner, który wypełnia się z bazy danych:
catSpinner = (Spinner) findViewById(R.id.spinner1);
cursor = dataAdapter.getAllCategory();
startManagingCursor(cursor);
String[] from = new String[] { DataAdapter.CATEGORY_COL_NAME };
int[] to = new int[] { android.R.id.text1 };
SimpleCursorAdapter catAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_dropdown_item, cursor, from,to, 0);
catAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
catAdapter.notifyDataSetChanged();
catSpinner.setAdapter(catAdapter);
I chcę zadzwonićAlertDialog
kiedy wybieram ostatni element (Add new category...
).
Po dodaniu nowej kategorii chcę tego ”elementu (Add new category...
) ”był ostatni.
Jak mogę to zrobić?