5

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.

AppGeek
  • 137
  • 4
  • 13
  • possible duplicate of [Action bar navigation modes are deprecated in Android L](http://stackoverflow.com/questions/24473213/action-bar-navigation-modes-are-deprecated-in-android-l) – Dylan Watson Feb 04 '15 at 03:55

1 Answers1

6

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.

AADProgramming
  • 6,077
  • 11
  • 38
  • 58