I need your help to show remaining minutes instead of hours
15 minutes instead of 15:30
Sample: time left to start reservation: 15 minutes
private Notification getNotification(Date countdownEnds) {
DateFormat timeFormat = countdownTimeFormatFactory.getTimeFormat();
String countdownEndsString = timeFormat.format(countdownEnds);
String title = resources.getString(R.string.countdown_notification_title);
String text = resources.getString(R.string.countdown_notification_text, countdownEndsString);
PendingIntent tapIntent =
PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setContentTitle(title)
.setContentText(text)
.setTicker(title)
.setSmallIcon(R.mipmap.ic_launcher)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setContentIntent(tapIntent)
.setOngoing(true)
.setAutoCancel(false);
return builder.build();
}
public DateFormat getTimeFormat() {
return android.text.format.DateFormat.getTimeFormat(context);
}
kod:code