title: Fragments inside Activity - with Toolbar and Action buttons (similar to Windows windows)
body: <p>I would like to have an <code>Activity</code> populated with <code>Fragments</code>. Every <code>Fragment</code> behaves as a windows in Windows OS - it has its <code>Toolbar</code> with title and action buttons:</p>
  
  <p><a href="https://i.stack.imgur.com/TAh5Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TAh5Y.png" alt="enter image description here"></a></p>
  
  <p><strong>Fragment</strong>:</p>
  
  <pre><code>    @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Show Toolbar in Fragment
          setHasOptionsMenu(true);
  
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.fragment_entries_list, container, false);
      }
  
      @Override
      public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
          super.onCreateOptionsMenu(menu, inflater);
  
          inflater.inflate(R.menu.menu_common, menu);
      }
  </code></pre>
  
  <hr>
  
  <p><strong>Question:</strong></p>
  
  <ol>
  <li>How to change the title of the <code>Fragment</code>?</li>
  <li>How to display three-dot actions button?</li>
  </ol>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>I have now modified <strong>menu_common.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
      &lt;item
          android:id="@+id/action_categories"
          android:title="Categories"
          android:visible="true"
          app:showAsAction="never"/&gt;
      &lt;item
          android:id="@+id/action_settings"
          android:title="Settings"/&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p><strong>Fragment</strong></p>
  
  <pre><code>@Override
      public void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setHasOptionsMenu(true);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          ViewGroup view = (ViewGroup) inflater.inflate(
                  R.layout.fragment_entries_list, container, false);
  
          // Toolbar
          Toolbar toolbar = (Toolbar) view.findViewById(R.id.tb_actions);
          toolbar.setTitle("Bar");
          toolbar.showOverflowMenu();
          setHasOptionsMenu(true);
  
          // Inflate the layout for this fragment
          return view;
      }
  
      @Override
      public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
          super.onCreateOptionsMenu(menu, inflater);
          inflater.inflate(R.menu.menu_common, menu);
      }
  </code></pre>
  
  <p><strong>Edit 2</strong>:</p>
  
  <p>This is what I want to achieve:</p>
  
  <p><a href="https://i.stack.imgur.com/wYhKy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYhKy.png" alt="enter image description here"></a></p>