80,351
社区成员
发帖
与我相关
我的任务
分享
返回的是int类型的240,,这样算完显示的是00:24,对么?
int time =1200;
text.setText(String.format("%02d", time / 60) + ":" + String.format("%02d", time % 60));
int time =1200;
int minutes = time / 60;
int seconds = time % 60;
text.setText(String.format("%02d", minutes) + ":" + String.format("%02d", seconds));