Prithniraj Nicyone Prithniraj Nicyone - 1 month ago 7
Android Question

SetError with setFocusable(false) in android

I am having an edittext and an icon. Clicking on this icon I show DateTime Picker. I have set

setFocusable(false);
and using setError on this edittext. But when any error occurs only icon is getting shown. Text is not getting shown at all. I have tried
_input.setFocusableInTouchMode(true);
also but it gives users to enter any text in this edittext which I do not want as I have created this edittext for date time only.

So, how can I show the error message then, can someone please help me.

Thanks a lot in advanced.

Answer

Why do you use an edittext, if you do not want the user to input text? you can use a textView and textView.setText("your time") instead.

Comments