Search code examples
androidlayouttimepicker

Setting Android TimePicker In XML


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.


Solution

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

    MyTimePicker.setIs24HourView(boolean);