I have an EditText in my Activity that users must enter date in it in my desired format like ____/__/__
. Is there any way to show this format in EditText of Android like mask textboxes of some programming languages?
Thanks,
editText.setHint("____/__/__");
OR
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="____/__/__"/>
EDIT
I would recommend a DatePicker
though rather than having users enter numbers and slashes. If DatePicker
is not an option, I would then recommend 3 EditTexts that each have their own hint and which possibly automatically move between each other when they reach their automatic size.
[2012]/[01]/[01]