如何将来自notificationserviceListener的PendingIntent作为对象保存到Realm中?

时间:2017-10-13 16:15:01

标签: android notifications android-notifications notificationservices

使用NotificationServiceLister,我检索pendingIntent通知。现在我想将pendingIntent作为对象存储到任何离线数据库中,例如realm, greendao, sqlite, ormLite, active android等。这可能吗?如果那可能,那么,怎么样?或者有没有其他方法可以找到任何特定通知的pendingIntent ???

1 个答案:

答案 0 :(得分:0)

而不是保存pendingIntent对象。您可以将唯一通知ID存储到数据库中。点击Notification活动即可启动,您可以在其中提取notification id,并通过将其与您的本地数据库进行比较来查看点击的通知。