在SQLite中存储PendingIntents还是使用其他方法?

时间:2016-01-17 17:29:30

标签: android sqlite android-intent

我尝试记录所有收到的通知,以便在我的应用中显示它的历史记录。

我设法以这种方式存储标题,文字等详细信息,但是如何存储每个通知的pendingIntent?

我无法在SQLite AFAIK中执行此操作。有任何想法吗?

1 个答案:

答案 0 :(得分:2)

  

但是如何存储每个通知的pendingIntent?

你没有。 PendingIntent仅存在于内存中。从PendingIntent中提取数据,你没有重要的getter方法。并且,它包含的部分内容 - 有关创建PendingIntent的应用程序的信息 - 您无法再现。

如果这些您的 PendingIntents,您可以首先保存用于创建它们的信息。但是,它们是PendingIntents由其他应用创建的,因此无法以任何有意义的方式保留它们。