2
I have an Edittext that when clicking on it opens a Datepicker, how to prevent the user from typing in Edittext? I tried to use edtData.setEnable(false) but clicking on editText nothing happens.
2
I have an Edittext that when clicking on it opens a Datepicker, how to prevent the user from typing in Edittext? I tried to use edtData.setEnable(false) but clicking on editText nothing happens.
2
Add the following to Edittext:
android:focusable="false"
This will prevent Edittext from receiving phocus, not allowing you to type in it.
Alternatively use a Textview instead of Edittext.
For Textview to look like an Edittext use:
style="@android:style/Widget.EditText"
1
To avoid editing in Edittext set Keylistener to null
edtData.setKeyListener(null);
That doesn’t work.
You’re right, thank you, I typed wrong, I just corrected my answer, hugs
Yes, it already works and is an interesting solution.
Browser other questions tagged android edittext
You are not signed in. Login or sign up in order to post.
thanks, that’s exactly what I wanted.
– fabricio b.
Very good solution
– WiseTap