title: Android Action bar custom dropdown view on item click
body: <p>I'm writing an Android app for tablets. I've gone with the action bar to create my icons. However, I need to open a custom view when one of the menu items is clicked.</p>
  
  <p>I don't want a custom action bar - I need to inflate a custom view when the "Browse Subjects" action bar item is clicked. This view will need to appear like a dropdown but be using my own custom layout as it will not be used for navigation.</p>
  
  <p><img src="https://i.stack.imgur.com/3Ohry.png" alt="Drop down menu"></p>
  
  <p>Here is my menu.xml</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:id="@+id/menu_browse"
          android:title="Browse Subjects"
          android:showAsAction="always"
          android:actionLayout="@layout/action_layout_browse"
          android:actionProviderClass="au.com.pearson.f12catalogue.action_providers.BrowseProvider"
              /&gt;
      &lt;item android:id="@+id/menu_settings"
          android:title="Settings"
          android:orderInCategory="100"
          android:showAsAction="never" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>I assumed the ActionProviderClass would allow me to instantiate a custom view when the action bar item is clicked but I can't work out a way - perhaps I'm going down the wrong path.</p>
  
  <p>Any help on this would be <strong>MUCH</strong> appreciated! Thanks!</p>
  
  <p>UPDATE:
  Thanks for links to action bar styling but I don't want to simply style a dropdown. I want to inflate a custom view. The view will perform DB queries etc aswell.</p>