Restrict input to date only in Android EditText

  • Replies:3
  • OpenNot stickiedAnswered
  • Forum posts: 5

Sep 11, 2018, 7:49:04 PM via Website

I would like the user to input date only in my Android app EditText. I am opening the calendar when the user focus on the EditText control. But sometimes the built-in keyboard appears on focussing instead of calendar. How can I restrict date only here? Here is my EditText in activity_main.

 <EditText android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:id="@+id/tEndDate"

    android:layout_marginBottom="2dip" android:textAlignment="textEnd"/>
Reply
  • Forum posts: 5

Sep 13, 2018, 8:47:50 PM via Website

Thanks a lot James. That worked !!! I have really started liking Android development !!! Cool..

Helpful?
Reply

Recommended articles