title: How to avoid a IllegalStateException: ActionBarContextView in older app
body: <p>We have an app that's been working for years.  So it does NOT use all the latest and greatest features.</p>
  
  <p>We've found that on current versions of Android, IF there is text in an EditText control AND you long-touch it - the app crashes with:</p>
  
  <pre><code>11-13 14:26:20.720: E/AndroidRuntime(1253): FATAL EXCEPTION: main
  11-13 14:26:20.720: E/AndroidRuntime(1253): java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="match_parent" (or fill_parent)
  11-13 14:26:20.720: E/AndroidRuntime(1253):     at com.android.internal.widget.ActionBarContextView.onMeasure(ActionBarContextView.java:325)
  11-13 14:26:20.720: E/AndroidRuntime(1253):     at android.view.View.measure(View.java:12603)
  11-13 14:26:20.720: E/AndroidRuntime(1253):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4677)
  11-13 14:26:20.720: E/AndroidRuntime(1253):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369)
  11-13 14:26:20.720: E/AndroidRuntime(1253):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
  </code></pre>
  
  <p>I know that we have no references to an ActionBarContextView anywhere in our xml or java files, nor do we use any Themes.
  These EditText controls are in Activities, not Dialogs.</p>
  
  <p>We do have a Custom layout as our root layout, and the crash stacktrace does eventually get back to one if it's methods:</p>
  
  <pre><code>  @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
      final int count = getChildCount();
  
      for (int i = 0; i &lt; count; i++) {
        final View child = getChildAt(i);
        measureChild(child, widthMeasureSpec, heightMeasureSpec);
      }
      setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));
    }
  </code></pre>
  
  <p>Any ideas where to look, or what to change?</p>