Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

My emulator date input type has a forward slash (/), my device does not?

Problem: My emulator date input type has a forward slash and numbers (/), my device does not?

I’m not sure what to try on this, except I had to create a workaround which involved using a text field with an `android:digits="0123456789/" constraint. Any thoughts on the reason why?

The physical device is a Samsung A32 5G it has numbers only and no ‘/’ and the emulator does.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

… was this …

android:inputType="date"

… now this …

android:inputType="text"
android:digits="@string/allowDateCharacters"

>Solution :

Problem: My emulator date input type has a forward slash and numbers (/), my device does not?

This is not a problem.

There are ~3 billion Android devices in use, across tens of thousands of device models. There are dozens of soft keyboards ("input method editors") that ship pre-installed on those device models, and there are dozens more that those billions of users can install from the Play Store and elsewhere.

What keys a soft keyboard offers for a given android:inputType is up to the developers of the soft keyboard — it is not up to you or I. Consider
android:inputType to be a suggestion, not a command.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading