title: Manually inflating custom view yields different layouts for ActionBar custom view
body: <p>Custom view from resource:  </p>
  
  <pre><code>// Set up the action bar.
  final ActionBar actionBar = getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
  actionBar.setCustomView(R.layout.custom_action_bar);
  actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  </code></pre>
  
  <p>the result is:<br>
  <img src="https://i.stack.imgur.com/uW6O3.png" alt="enter image description here"></p>
  
  <p>Custom view manually inflated:  </p>
  
  <pre><code>// Set up the action bar.
  final ActionBar actionBar = getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
  LayoutInflater inflater = (LayoutInflater) this .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View view = inflater.inflate(R.layout.custom_action_bar, null);
  actionBar.setCustomView(view);
  actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  </code></pre>
  
  <p>the result is:<br>
  <img src="https://i.stack.imgur.com/yyIWA.png" alt="enter image description here"></p>
  
  <p>custom_action_bar.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal" 
      android:weightSum="3"&gt;
  
      &lt;TextView 
          android:id="@+id/bar_title1"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:textColor="@color/White"
          android:text="title1"/&gt;
      &lt;TextView 
          android:id="@+id/bar_title2"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:textColor="@color/White"
          android:text="title2"/&gt;
      &lt;TextView 
          android:id="@+id/bar_title3"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:textColor="@color/White"
          android:text="title3"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The first layout shown here is the correct one, because it has weights on its widgets. The second attempt should produce the same result, but it does not.</p>