Restrict input to date only in Android EditText

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

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: 3

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
  • Forum posts: 848

Sep 14, 2018 1:24:58 AM via Website

You are welcome Suresh. :D Would you like to support a 5-star for my free app as mentioned in my forum signature. Thanks in advance. (smug):D

— modified on Sep 15, 2018 3:58:50 AM

Apk size only 0.07 MB. Google Play - https://goo.gl/ws42fN
App screenshots on Amazon Cloud - https://goo.gl/HS6TSZ

Helpful?
Reply

Recommended articles