title: How to customize Android ActionBar to show a custom view before the tabs?
body: <p>I'm using a custom view for the ActionBar with Tabs. My problem is the ordering of the custom view. Android is displaying it <strong>AFTER</strong> the tabs - which I do not want.</p>
  
  <p>I want the custom view displayed <strong>BEFORE</strong> the tabs. </p>
  
  <p>Is there a way to customize the actionBar to show the custom view before the tabs? or is this not possible? </p>
  
  <p>Code:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      final ActionBar bar = getActionBar();
      bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  
      View customActionBarView = 
          getLayoutInflater().inflate(R.layout.home_actionbar, null, true);
      ActionBar.LayoutParams lp = 
          new ActionBar.LayoutParams(LayoutParams.WRAP_CONTENT, 
              LayoutParams.WRAP_CONTENT);
  
      lp.gravity = Gravity.START;
      bar.setCustomView(customActionBarView, lp);
      bar.setLogo(R.drawable.logo);
      bar.setHomeButtonEnabled(true);
      bar.setDisplayShowCustomEnabled(true);
  
      bar.addTab(bar.newTab()
          .setText("Stuff")
          .setTabListener(new TabListener&lt;StuffFragment&gt;(
              this, "stuff", StuffFragment.class)));
  
      bar.addTab(bar.newTab()
          .setText("Friends")
          .setTabListener(new TabListener&lt;ContactsFragment&gt;(
              this, "friends", ContactsFragment.class)));
  
      bar.addTab(bar.newTab()
          .setText("Messages")
          .setTabListener(new TabListener&lt;ConversationsFragment&gt;(
              this, "messages", ConversationsFragment.class)));
  
      if (savedInstanceState != null) {
          bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
      }
  
      bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | 
          ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);
  
      bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);    
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Mm7de.png" alt="enter image description here"></p>