Setting Android TimePicker In XML

Pijusn picture Pijusn · Jul 22, 2011 · Viewed 22.6k times · Source

Is it possible to set TimePicker hours mode to 24-hours-mode in XML file? Or is it posible in Java only? I want to make a layout that has 24-hours picker but I can't find such attribute.

Answer

Guillaume picture Guillaume · Jul 22, 2011

No, you can't set the 24 hours mode in the XML, you have to use

MyTimePicker.setIs24HourView(boolean);