I am trying to convert a CountdownTimer
into a correct time. I have tried regular expressions but I am always weak in these.
Here is my code.
Integer timeCount = (int) (millisUntilFinished/1000);
int min = timeCount / 60;
int sec = timeCount % 60;
textView.setText(min + ":" + sec);
This code is showing me time 1:5
WHERE it should show me 01:05
. How can i do thaT.
Best Regards
textView.setText(String.format("%02d:%02d", min, sec));
– Selvin Sep 3 '12 at 12:47