As @Rami said:
Those tabs in your picture are not in the ActionBar, they are under
the ActionBar
And you can use that with TabLayout
(from support library) or the other libraries.which the TabLayout
is the best option to use.
Here is a good tutorial: https://guides.codepath.com/android/google-play-style-tabs-using-tablayout
And check this link too: How to implement android TabLayout design support libarary with Swipe views
Example:
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
Take a look: Tabs in TabLayout not filling up entire ActionBar