I'm making somekind of stopwatch and with this code i'm calculating elapsed time:
int seconds = (int) (millis / 1000);
int minutes = seconds / 60;
seconds = seconds % 60;
int milliseconds = (int) (millis%1000);
int hours = minutes / 60;
labelTime.setText(String.format("%02d", hours) + ":" + String.format("%02d", minutes) + ":" + String.format("%02d",seconds)+ ":" + String.format("%03d",milliseconds));
This works, but after 1 hour my stopwatch shows for example 01:61:22 instead of 01:01:22. How to start minutes from 0?
why don't you just use something like: