【发布时间】:2017-01-20 23:54:57
【问题描述】:
我已经成功实现秒表,但我没有得到像 mm:ss 这样的两位数的正确毫秒数。SS 02:54.12,我的代码是
private Runnable updateTimerThread = new Runnable() {
public void run() {
timeMill=timeMill+100;
updateTime(timeMill);
stopWatchHandler.postDelayed(this, 100);
}
};
private void updateTime(long updatedTime) {
//I want to convert this updateTime to Milliseonds like two digit 23
}
我也试过这个final int mill = (int) (updatedTime % 1000); 但这总是得到 10、20、30...等等,但我想得到 10、11、12、13..等等,如果你有任何想法请帮帮我。
【问题讨论】:
标签: android runnable stopwatch