Now all methods related to navigation modes in the ActionBar
class, such as setNavigationMode()
... are now deprecated.
The documentation explains:
Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other common navigation patterns instead.
In my current application, there is a spinner on ActionBar. How do I apply NAVIGATION_MODE_LIST
on the new widget Toolbar in the new version appcompat v7 21.
Thanks in advance.
As usual Gabriele is right, so your code will look like that:
So It will look like something like that:
And take care not to use spinnerAdapter (because you won't be able to manage its style using the AppTheme).
And if you want to use Tab (NavigationMode.Tabs) you should use now the Design library (explained here:http://android-developers.blogspot.fr/2015/05/android-design-support-library.html?m=1)and copy paste below "
"
With the API 21 the method
setNavigationMode(ActionBar.NAVIGATION_MODE_LIST)
is deprecated.The best way to work with a spinner is to use a Toolbar like this:
You can find an example in the Google IO 2014