Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextView inputType date in Android - how does it work?

I have not found this in any documentation, tutorial or question. Pretty much all tutorials concerned date picker, so I am confused about its functionality.

I have TextView with inputType="date". How do I handle it? Does actually it do anything other than text field does?

What are best practices?

It only has set/get methods for String type. Am I right in assumption that I have to parse contents manually? And if putting in default value, having to format it myself too?

Is there any definition of expected date format? Does it handle Locale differences (mm/dd/yyyy in some, dd/mm/yyyy in other)?

Is there any validation?

Or is it basically "do it yourself" type thing without much convenience?

like image 386
zwei Avatar asked Jun 30 '26 19:06

zwei


1 Answers

input type date means it will open numeric virtual keyboard on the screen when the user tap the textview. To parse it to your required format, you have to use JAVA date time class.

like image 131
Mark Henry Avatar answered Jul 02 '26 08:07

Mark Henry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!