I need to add a spinner to the top menu bar in my Android app as seen below:
Before Android 5.0, I simply used:
final android.app.ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false); // DEPRACATED
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST)
but that method was deprecated. I have gone through all the samples at: http://developer.android.com/samples/ui.html but not a single one had a spinner/dropdown menu to base my code off of.
Given NAVIGATION_MODE_LIST is deprecated, how can I add a spinner that will be compatible with Android 5.0, and all the previous versions?
UPDATE: After adding the tool bar as can be seen in my code, the error occurs as it notes it cannot see the import even though android.support.v7.widget.Toolbar
; is clearly listed