Android examples for java.util.concurrent:TimeUnit
get Duration String from duration milliseconds
import java.util.concurrent.TimeUnit; public class Main { public static String getDurationString(long durationMs) { return String.format("%02d:%02d", TimeUnit.MILLISECONDS.toMinutes(durationMs), TimeUnit.MILLISECONDS.toSeconds(durationMs) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(durationMs))); }/*from ww w . j a va2s . c o m*/ }