I want to remove the seconds and AM/PM indication from the digital clock widget but I don't know how to do this.
It is hard-coded in the DigitalClock class, so you can't change it programatically. The only way to change it is to re-implement DigitalClock widget. Yo can get source code from here.
You need to copy this code in your project, rename it like "MyDigitalClock" and use this one as your widget. As you will see in the implementation, there are two variables you should focus on to get what you want:
private final static String m12 = "h:mm:ss aa";
private final static String m24 = "k:mm:ss";
ss represents seconds and aa represents am/pm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With