I\'m using a basic DatePicker and I\'m trying to figure out how to hide the Year field on the DatePickerDialog so that only the Month and Day are visible. I don\'t mind that
Be really careful with this solution. you are using reflexion to access a field and change the visibility. This will not work with Android 5.0 ! Google have changed the implementation of the TimePicker and DatePicker and the classes are no longer exposing any fields appart from the delegate.
I don't know the solution yet for Android 5.0+.I will let you know as soon I found something interesting.
As an idea, you could use the Build.VERSION.SDK_INT to check the Android version and then try to access the DatePickerSpinnerDelegate using reflexion and set the field you want.
Again, this is not the ideal solution as Google are free to change this again and again...