I have an EditText field that has this
android:inputType="time"
I want to enable it with a button press (like change time) and disable it when done with another button press (like Enter). Someone suggested that you can disable an EditText field with
textView02.setInputType(null);
Which works, but I can’t figure out how to get it back to having the default method enabled.
The other thing I tried, and it comes close to working is to turn off the field with this
textView02.setInputType(InputType.TYPE_NULL);
And turn it back on with this
textView02.setInputType(InputType.TYPE_DATETIME_VARIATION_TIME);
But I get the full keyboard requiring shifting to symbols to get the :
I thought I could use this
textView02.setInputType(InputType.TYPE_CLASS_DATETIME);
but I get unwanted characters / and – and worse than that it takes a long press on my phone to get the : instead of the /
PS. In a perfect world I would not need the enter function but instead rely on the done key on the pop-up keyboard. But I can live with a dedicated button.
Allen
And to reenable, pass it true.