D dpann New Member Licensed User Mar 22, 2019 #1 Hi All, I want to disable the "selectability" of an EditText I tried both following codes without any success (the EditText remains selectable if I make a long touch on the text) Code 1 : Dim jo As JavaObject = EditText1 ' jo.RunMethod("setTextIsSelectable", Array As Object(False)) Code 2 : Dim r As Reflector r.Target = EditText1 r.RunMethod2("setTextIsSelectable",False,"java.lang.boolean") Thanks for your help
Hi All, I want to disable the "selectability" of an EditText I tried both following codes without any success (the EditText remains selectable if I make a long touch on the text) Code 1 : Dim jo As JavaObject = EditText1 ' jo.RunMethod("setTextIsSelectable", Array As Object(False)) Code 2 : Dim r As Reflector r.Target = EditText1 r.RunMethod2("setTextIsSelectable",False,"java.lang.boolean") Thanks for your help
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2019 #2 Please use [code]code here...[/code] tags when posting code. There is no difference between the two code snippets. 1. Why do you need to make it not-selectable? 2. If you don't need the EditText to be editable then you can set the input type to none. Upvote 0
Please use [code]code here...[/code] tags when posting code. There is no difference between the two code snippets. 1. Why do you need to make it not-selectable? 2. If you don't need the EditText to be editable then you can set the input type to none.
D dpann New Member Licensed User Mar 25, 2019 #3 1. Finally, I found the solution. It seems there is a bug in the SDK, therefore you need to make it Selectable before making it not Selectable. The following snippet works : Code: Copy Dim jo As JavaObject = EditText1 ' jo.RunMethod("setTextIsSelectable", Array As Object(True)) ' jo.RunMethod("setTextIsSelectable", Array As Object(False)) 2. I wanted to make it not Selectable to disable the "Long touch" event which shows the two selection handles but it disable everything ... Finally, I found in the forum a good example of a custom EditText which can be configured exactly according to what you want. Upvote 0
1. Finally, I found the solution. It seems there is a bug in the SDK, therefore you need to make it Selectable before making it not Selectable. The following snippet works : Code: Copy Dim jo As JavaObject = EditText1 ' jo.RunMethod("setTextIsSelectable", Array As Object(True)) ' jo.RunMethod("setTextIsSelectable", Array As Object(False)) 2. I wanted to make it not Selectable to disable the "Long touch" event which shows the two selection handles but it disable everything ... Finally, I found in the forum a good example of a custom EditText which can be configured exactly according to what you want.