Skip to content Skip to sidebar Skip to footer

Illegal State Exception On Double Clicking A Edittext

Hi I am getting an illegal state exception on double clicking a EditText .Here is the stack trace.pls help 06-30 11:18:24.970: ERROR/AndroidRuntime(3011): java.lang.IllegalStateExc

Solution 1:

Try checking the solution provided here:

http://code.google.com/p/android/issues/detail?id=19021

EDIT:

The solution suggests the following:

Change:

<stylename="MyDialogTheme"><itemname="android:windowBackground">@android:color/transparent</item><itemname="android:windowNoTitle">true</item><itemname="android:windowIsFloating">true</item><itemname="android:windowContentOverlay">@null</item><itemname="android:windowAnimationStyle">@android:style/Animation.Dialog</item><itemname="android:windowIsTranslucent">true</item><itemname="android:windowFrame">@null</item><itemname="android:backgroundDimEnabled">false</item></style>

To this:

<stylename="MyDialogTheme"parent="@android:style/Theme.Dialog"><itemname="android:windowBackground">@android:color/transparent</item><itemname="android:windowNoTitle">true</item><itemname="android:windowIsFloating">true</item><itemname="android:windowContentOverlay">@null</item><itemname="android:windowAnimationStyle">@android:style/Animation.Dialog</item><itemname="android:windowIsTranslucent">true</item><itemname="android:windowFrame">@null</item><itemname="android:backgroundDimEnabled">false</item>

Solution 2:

If you read the first line it says ActionBarContextView can only be used with android:layout_width="match_parent" (or fill_parent). In other words, something in your layout has a invalid android:layout_width. Check that...

Solution 3:

I think the problem comes from the layout you implemented.

I guess you gave a size for your actionBarContextView and this is not possible. You have to choose fill_parent or match_parent for this item.

Solution 4:

In results of next example are:

  • disable context menu (double click etc.),
  • and prevent crash on dialog on input's event.


editText.setCustomSelectionActionModeCallback(newEditTextNoContextHelper());

publicclassEditTextNoContextHelperimplementsActionMode.Callback
{
    publicbooleanonCreateActionMode(ActionMode mode, Menu menu)
    {
        returnfalse;
    }
    publicbooleanonPrepareActionMode(ActionMode mode, Menu menu)
    {
        returnfalse;
    }
    publicbooleanonActionItemClicked(ActionMode mode, MenuItem item)
    {
        returnfalse;
    }
    publicvoidonDestroyActionMode(ActionMode mode)
    {
    }
}

Post a Comment for "Illegal State Exception On Double Clicking A Edittext"