How to display count of notifications in app launcher icon [duplicate]

Android (“vanilla” android without custom launchers and touch interfaces) does not allow changing of the application icon, because it is sealed in the .apk tightly once the program is compiled. There is no way to change it to a ‘drawable’ programmatically using standard APIs. You may achieve your goal by using a widget instead of … Read more

show remaining minutes instead of hours

Barebones solution: long remainingMillis = countdownEnds.getTime() – System.currentTimeMillis(); long remainingMinutes = TimeUnit.MILLISECONDS.toMinutes(remainingMillis); String countdownEndsString = String.format(“%d minutes”, remainingMinutes); For a nicer solution use java.time, the modern Java date and time API, for the calculation of the minutes: long remainingMinutes = ChronoUnit.MINUTES.between( Instant.now(), DateTimeUtils.toInstant(countdownEnds)); In this case also see if you can get rid of the … Read more