Add View Below Toolbar in android
<p>I am adding a view in ViewPager programmatically But when I do so my layout does not starts below actionbar. It overlaps with actionbar.</p>

<p>Here is screenshot of app.</p>

<p><a href="https://i.stack.imgur.com/2rlVg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2rlVg.jpg" alt="enter image description here"></a> </p>

<p>In my Pager adapter I have wrote this code.</p>

<blockquote>
  <p>ProductPagerAdapter.java</p>
</blockquote>

<pre><code>@Override
    public Object instantiateItem(ViewGroup container, int position) {

        rate = list.get(position);

        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = inflater.inflate(R.layout.fragment_product, container,false);

        tvProdName = (TextView) v.findViewById(R.id.tvProdName);
        tvProdAmount = (TextView) v.findViewById(R.id.tvProdAmount);
        tvProdDesc = (TextView) v.findViewById(R.id.tvProdDesc);
        ivProdImage = (ImageView) v.findViewById(R.id.ivProdImage);

        tvProdName.setText(rate.Name);
        tvProdAmount.setText(rate.amount);
        tvProdDesc.setText(rate.longDescription);
        Picasso.with(context).load(rate.image).into(ivProdImage);

        ((ViewPager) container).addView(v);

        return v;
    }
</code></pre>

<blockquote>
  <p>fragment_product.xml</p>
</blockquote>

<pre><code>&lt;LinearLayout
    android:orientation="vertical"
    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"&gt;

    &lt;include layout="@layout/content_details"/&gt;

&lt;/LinearLayout&gt;
</code></pre>

<blockquote>
  <p>activity xml</p>
</blockquote>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.ashishkudale.linksolutions.DetailsActivity"&gt;

    &lt;android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"&gt;

        &lt;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/AppTheme.PopupOverlay" /&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;

    &lt;!--&lt;include layout="@layout/content_details"/&gt;--&gt;

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

    &lt;android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_dialog_email" /&gt;

&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>

<p>Can some tell me how to start layout below action bar programatically.</p>