Hide LongPress menu of an EditText

Inman

Well-Known Member
Licensed User
Longtime User
I know you can hide the keyboard for an EditText by setting InputType property as TYPE_NONE. But is it possible to prevent the longpress menu which contains Select All, Cut etc...from showing up?
 

kickaha

Well-Known Member
Licensed User
Longtime User
This is not documented anywhere that I can find, but the LongClick of the EditText is valid.
All you have to do is insert this sub:
B4X:
Sub text_LongClick ' Put your EditTexet name in place of "text"
Return True
End Sub
in your code. It catches the long click, and by returning True it consumes it before the OS acts on it.
 
Upvote 0
Top