Android Question Edittext disabled but clickable

milanjo

Member
Licensed User
Longtime User
Hi,

I'm using reflection to use linkify - I want to have links (URL, Emails, Phone numbers ...) in my edittext marked (linked). Linkify worked as I expected. But when I set up edittext.enable = false I cannot edit it (thats what I want) but also I cannot click on marked links (that which I don't want). I have found some solutions by xml or code in java but I haven't found solution in B4A. If I try to switch from edittext to label - label doesn't contain preference SelectionStart which I need. My text should be always scrolled at bottom.

Could somebody help? Thank you very much.
 

DonManfred

Expert
Licensed User
Longtime User
have you tried
B4X:
Dim cbJO As JavaObject = EditText1
cbJO.RunMethod("setClickable",Array As Object(true))
after you disabled it
 
Upvote 0

milanjo

Member
Licensed User
Longtime User
Try this:
B4X:
Dim jo As JavaObject = EditText1
jo.RunMethod("setFocusable", Array(false))

Thank - I have tried it but it doesn't work. Source code in attachment. Try to add some (link or anything else (phone number, email ...) into txtLog (edittext) during ActivityCreate sub and then open app and try to click on link). Thank you.
 

Attachments

  • dalsi_na_forum.zip
    13 KB · Views: 269
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Hi,

I'm using reflection to use linkify - I want to have links (URL, Emails, Phone numbers ...) in my edittext marked (linked). Linkify worked as I expected. But when I set up edittext.enable = false I cannot edit it (thats what I want) but also I cannot click on marked links (that which I don't want). I have found some solutions by xml or code in java but I haven't found solution in B4A. If I try to switch from edittext to label - label doesn't contain preference SelectionStart which I need. My text should be always scrolled at bottom.

Could somebody help? Thank you very much.
Did you try my Masked EditText lib with ReadOnly set to true?
 
Upvote 0
Top