0

I want to create a custom TimePicker with a 15-minute interval. I found a lot of resources around the Internet showing examples about custom TimePickerDialog.

I don't have any idea about how to implement a custom TimePicker. For the moment, I have this in my XML layout:

<TimePicker 
    android:id="@+id/timePicker"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

and I instantiate it in my Java this way:

tp = (TimePicker) findViewById(R.id.timePicker);

There are many questions I'm asking myself:

  1. What must I do to get a CustomTimePicker? Is extending Android's native TimePicker enough?
  2. What methods must be overridden to implement the 15-minute interval?
  3. If I manage to get my CustomTimePicker, how to declare it in my XML, since Android's parser won't understand a <CustomTimePicker /> tag?

Thanks for your help!

Richard-Degenne
  • 2,892
  • 2
  • 26
  • 43
  • http://stackoverflow.com/questions/20214547/show-timepicker-with-minutes-intervals-in-android – shkschneider Apr 23 '14 at 14:50
  • @shkschneider: I've already seen this post, but, as said above, it concerns a TimePickerDialog, not a TimePicker. Plus it doesn't say anything about what to do with the newly created CustomTimePickerDialog so as to display it in an activity. – Richard-Degenne Apr 23 '14 at 14:56
  • @RichouHunter undelete your other question please http://stackoverflow.com/q/23342318 – Zombo Apr 28 '14 at 13:47

0 Answers0