M. Witney M. Witney - 1 month ago 9
Java Question

Disable clickevent after edittext clicked in android

There is one edittext view which users should enter valid e-mail address.Click handler automaticly adds allowed domain "@stackoverflow.com". I mean if u click the edittext program java sets the text as @stackoverflow.com
and users enter their id like nameSurname@stackoverflow.com

Problem is if u type wrong character and click again to edittext it set the text again @stackoverflow.com

Example nameSrname@stackoverflow.com but you want to type nameSurname@stackoverflow.com u click the edittext to fix but it is @stackoverflow.com again.

How to disable second,third... click event but enable only first click event?

Why cant i set the text without click event? Because i cant show the hint text if i do that.

Answer Source

Add verification by clicking

 if (youEditText.getText().toString().isEmpty()) {
        //insert domain "@stackoverflow.com