Check Here
Suppose formatSecond=01
sec = Integer.parseInt(formatSecond); //this converts 01 to back 1
min = Integer.parseInt(formatMinute);
hr = Integer.parseInt(formatHour);
Very Simple
First Change to final DecimalFormat format = new DecimalFormat("00");
Now use format.format(Double.valueOf(hr or min or sec))
So your code Should be:
timeCounter.setText("time= " + format.format(Double.valueOf(hr)) + ":"
+format.format(Double.valueOf(min)) + ":"
+ format.format(Double.valueOf(sec)));
Output:
time=00:01:05 // As you Required
I have tested and working as per the Question's Requirement