How To Hide Or Disable Minutes Widget In Android Timepickerdialog?
I'm working on an application where i want to give user the ability of just to select Hours and AM/PM but Minutes widget should be fixed as i mentioned. I am using TimePickerDialog
Solution 1:
Solution 2:
There's no direct way. TimePickerDialog doesn't even give you TimePicker that it's using. So you'd have to copy code from TimePickerDialog.java to suit your own needs.
Another part is that TimePicker doesn't give you access to its sub-views (id's are not public), so you'd also need to copy time_picker.xml from Android sources, and create your own TimePicker view.
Good news is that you can copy from Android source code, and both mentioned sources are rather short, so it's relatively easy task to make this work.
Post a Comment for "How To Hide Or Disable Minutes Widget In Android Timepickerdialog?"