【发布时间】:2018-07-08 13:12:50
【问题描述】:
我根据用户在应用中插入的一些值设置了一个待处理的通知,如下所示:
val notificationAlarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
val notificationIntent = Intent(this, ReminderBroadcastReceiver::class.java)
notificationIntent.putExtra("bytes", bytes)
val pendingNotificationIntent = PendingIntent.getBroadcast(this, REQUEST_CODE, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT)
myCalendar.set(Calendar.HOUR_OF_DAY, 10)
notificationAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, myCalendar.timeInMillis,
NOTIFICATION_OFFSET,
pendingNotificationIntent)
由于这是一个重复的意图,我只能计算第一个通知,无法计算之后的那些。
我如何才能获得通知将再次显示的剩余时间?
【问题讨论】:
标签: android push-notification kotlin android-pendingintent