How to pick a second using TimePicker, android

One quick and dirty way is to use two TimePickers, One for hours,minutes, and use the minutes on the other one as secunds. Hide the unused hours under the first minutes. This only works in 24 hour mode. Must declare timepicker for seconds first so locates under.

<RelativeLayout
  <TimePicker
    android:id="@+id/timePicker_Sec"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="76dp" />
  <TimePicker
    android:id="@+id/timePicker"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/timePicker_Sec"   
    android:layout_marginLeft="0dp" />
</RelativeLayout>

I think the best solution is to create your own TimePicker, by using the Time-class and three NumberPickers.


I've published an open source project on GitHub which has TimePicker with seconds:

https://github.com/IvanKovac/TimePickerWithSeconds

Have a look.

enter image description here