A real lazy way to do this, as long as you know that you won't have more than 60 minutes, you just need to make a date and use SimpleDateFormat
public void onTick(long millisUntilFinished) {
SimpleDateFormat dateFormat = new SimpleDateFormat("mm:ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
Date date = new Date(millisUntilFinished);
text.setText("Time left:" + dateFormat.format(date));
}
source
share