Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what can I use instead of setNavigationMode

Tags:

android

Since setNavigationMode has been deprecated in API level 21 what can I use instead of setNavigationMode to create tabs.Is there an alternative library which I can use.

like image 208
AppGeek Avatar asked Feb 04 '15 03:02

AppGeek


1 Answers

Action bar navigation modes are deprecated in API level 21.

So, it is not just setNavigationMode but other stuff related to Action Bar such as addTab(), selectTab(), too are deprecated.

Other possible Alternatives:

1. PagerTabStrip: This is part of Android support library, and It is intended to be used as a child view of a ViewPager widget in XML layout.

2.Toolbar: Added in API Level 21, is a new class android.widget.Toolbar. As per Android docs, A Toolbar is a generalization of action bars for use within application layouts.

ToolBar is a view placed in your view hierarchy that provides a similar, but more focused, API to the action bar.

An application may choose to designate a Toolbar as the action bar for an Activity using the setActionBar() method.

It depends on your app design as to which one you may want to choose as vis-a-vis replacement.

Check THIS Link for more info.

like image 68
AADProgramming Avatar answered Oct 25 '22 15:10

AADProgramming