Illegal State exception on double clicking a edittext

后端 未结 4 1004
长发绾君心
长发绾君心 2021-01-20 22:12

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): ja         


        
4条回答
  •  猫巷女王i
    2021-01-20 22:24

    In results of next example are:

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

    
    editText.setCustomSelectionActionModeCallback(new EditTextNoContextHelper());

    public class EditTextNoContextHelper implements ActionMode.Callback { public boolean onCreateActionMode(ActionMode mode, Menu menu) { return false; } public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } public void onDestroyActionMode(ActionMode mode) { } }

提交回复
热议问题