title: Toolbar in DialogFragment
body: <p>In our app, we have a few fragments that can be shown either as fullscreen fragments or as dialog fragments. These fragments inherit from <code>DialogFragment</code> and we make sure to instantiate them correctly depending the mode the app is executed in (either fullscreen or dialog).</p>
  
  <p>We thought about adding some extra functionality to some of these dialog fragments after the latest changes in the <code>Toolbar</code> widget were introduced in the support library with Lollipop. The idea is to have the type of options menu we would normally have in an ordinary fragment (i.e. the options menu inflated after <code>onCreateOptionsMenu</code> is executed) present in our subclasses of <code>DialogFragment</code> ONLY when these are visualized as dialogs. In short: when the fragments are shown in fullscreen mode we inflate a traditional options menu, and when the fragments are shown as dialogs we would like to have the same options menu inflated but using the new toolbar widget in standalone mode.</p>
  
  <p>I followed the steps from <a href="http://android-developers.blogspot.dk/2014/10/appcompat-v21-material-design-for-pre.html" rel="noreferrer">http://android-developers.blogspot.dk/2014/10/appcompat-v21-material-design-for-pre.html</a> and I managed to "activate" the toolbar, but it seems the menu is not inflated - see attached screenshots (picture one fragment in fullscreen mode, and picture two in dialog mode).</p>
  
  <p>Is it even possible to inflate an options menu with the new toolbar in a <code>DialogFragment</code>?</p>
  
  <p><img src="https://i.stack.imgur.com/05n1B.png" alt="fullscreen mode"><img src="https://i.stack.imgur.com/GXlV6.png" alt="dialog mode"></p>