-1

i'd like to change format in my android chronometr to show millisecond. So far I used this tip:

    mChronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {
        public void onChronometerTick(Chronometer cArg) {
            long t = SystemClock.elapsedRealtime() - cArg.getBase();
            cArg.setText(DateFormat.format("kk:mm:ss", t));
        }
    });

but i dont know the symbols for millisecond. Is there something? Thanks!

4

1 回答 1

2

尝试:

   mChronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {
        public void onChronometerTick(Chronometer cArg) {
            long t = SystemClock.elapsedRealtime() - cArg.getBase();
            cArg.setText(DateFormat.format("kk:mm:ss:SSS", t));
        }
    });
于 2013-07-27T23:05:16.617 回答