I'm making a game with a timer and it tell's you how long you took to complete the game at the end, it's a basic game so some people may beat it in less than a minute so i want to know is there any way to detect if there if the minutes are equal to 00 so then i can set the text to say 00:12 seconds and if it's not equal to 00 then it will say 01:12 Minutes. This is the code that i am using to work out the times.
Date start = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("mm:ss");
And the work out the final time is simply
Date now = new Date();
sdf.format(new Date(now.getTime() - start.getTime()))