I have a timer that works, but I don't have leading zeros in the form of 00:00.000. How can I make that happen? Here's my code:
mEndTime = System.currentTimeMillis();
mTotalTime = mEndTime - mStartTime;
int seconds = (int) (mTotalTime / 1000);
int minutes = seconds / 60;
seconds = seconds % 60;
int millis = (int) mTotalTime % 1000;
String sectime = Integer.toString(seconds);
String milsectime = Integer.toString(millis);
String time = minutes + ":" + sectime + "." + milsectime;