title: Navigation view with fragment. Toolbar
body: <p>So, I have an activity with navigation view. By click on its item I change fragment in activity. All fragment have the same toolbar. But one have this toolbar and TabLayout to it. I would like to know what is better to declare toolbar once on activity like this </p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;include layout="@layout/toolbar" /&gt;
  
      &lt;FrameLayout
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_below="@+id/toolbar" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>or declare it in each fragment.</p>
  
  <p>The disadvantage of the first method is default toolbar shadow. When I add tabs in fragment, shadow looks like </p>
  
  <p><a href="https://i.stack.imgur.com/VAg3B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VAg3B.png" alt="enter image description here"></a></p>
  
  <p>When I tried 2 solution. All my toolbar was with back icon instead drawer animated logo. </p>
  
  <p>Thanks.</p>