How to add floating action button in tabs?
<p>I have a tabbed layout. So I have seven fragments. I want to add a floating action button on all fragments. So on all fragments there should only be on floating button. </p>

<p>I tried to add the fab in main activity layout, but it gets hidden by fragment it dose not show up. How can I achieve this? </p>

<p>I have used sliding tabs strips in this and sliding tabs layout.</p>

<p>Main activity layout :</p>

<pre><code>    &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" tools:context="com.adgatemedia.offerwallsdk.fragments.MainFragment"&gt;

    &lt;RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"&gt;

        &lt;utils.SlidingTabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="2dp"
            android:background="@color/colorPrimary"
            android:layout_alignParentTop="true" /&gt;

        &lt;android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:layout_below="@+id/tabs" /&gt;

        &lt;LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_gravity="bottom|end"&gt;

            &lt;include layout="@layout/myfab"/&gt;
        &lt;/LinearLayout&gt;

    &lt;/RelativeLayout&gt;
&lt;/FrameLayout&gt;
</code></pre>

<p>Adapter:</p>

<pre><code>    public class TabsPagerAdapter extends FragmentPagerAdapter {

    CharSequence Titles[];
    int NumbOfTabs;
    public TabsPagerAdapter(FragmentManager fm,CharSequence mTitles[], int mNumbOfTabsumb) {
        super(fm);
        this.Titles = mTitles;
        this.NumbOfTabs = mNumbOfTabsumb;
    }

    @Override
    public Fragment getItem(int index) {

        switch (index) {
            case 0:
                return new Mon();
            case 1:
                return new Tue();
            case 2:
                return new Wed();
            case 3:
                return new Thu();
            case 4:
                return new Fri();
            case 5:
                return new Sat();
            case 6:
                return new Sun();

        }
        return null;
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return Titles[position];
    }
    @Override
    public int getCount() {
        return NumbOfTabs;
    }
}
</code></pre>

<p>Thank you..</p>