I want to remove the seconds of DigitalClock.
I found a code of DigitalCLock : http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/widget/DigitalClock.java/?v=source
Now I use just DigitalClock like this:
DigitalClock dc = (DigitalClock) findViewById(R.id.digitalClock1);
How to use code from GrepCode ?
Because the formats for DigitalClock are private, the easiest way is to cut and paste the entire class into your project. Then make a couple changes:
":ss"portion of each format, for example changem24to"k:mm";.Lower the refresh rate in the Runnable from each second to each minute:
Now use it like any other widget (in XML scope it with your reversed package name):