Is it possible to remove AM/PM button from TimePicker?

NullPointerException picture NullPointerException · Nov 10, 2010 · Viewed 20.4k times · Source

I want to show 24 hours clock instead 12 hours using TimePicker,and I dont need the AM/PM buton, Simply want to show 24 hours clock.

Is this possible?

I used setIs24HourView(true) but it is is not working.

Suggest me How can I show 24 hours clock?

Answer

Bryan Denny picture Bryan Denny · Nov 10, 2010

Have you tried setting setIs24HourView?

If you just need use the NumberPicker widget in other abnormal ways:

There is a NumberPicker widget in Android, but it is a private API. This guy pulled out the code such that you can drop it into any project.

Here is an example of how I used it for tax rates:

alt text