I have an EditText that when clicking it opens a DatePicker, how do I prevent the user from typing in EditText? I tried to use edtData.setEnable (false) but when clicking on editText nothing happens.
I have an EditText that when clicking it opens a DatePicker, how do I prevent the user from typing in EditText? I tried to use edtData.setEnable (false) but when clicking on editText nothing happens.
Add to EditText the following:
android:focusable="false"
This will prevent EditText from getting focus , 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"
To avoid editing in EditText set KeyListener to null
edtData.setKeyListener(null);