【发布时间】:2015-08-27 18:28:52
【问题描述】:
我需要能够在我的任何类中使用我在 Java 类中创建的 Pending Intent 我该怎么做?
PendingIntent notifIntent;
notifIntent = notification.contentIntent;
需要使用它的原因是因为我将 Pending Intent 设置为 Notifications Pending Intent 是什么,然后在我的主要活动的 onClick 事件中我需要引用这个值。
【问题讨论】:
-
您需要更好地解释您的用例:您是否需要能够更新全局 PendingIntent,或者您只是想从应用程序的任何地方访问一个永不更改的 PendingIntent ?
-
@jvmk 我只想能够访问它我不想改变它
-
好的,它是如何实例化的?可以静态实例化吗?
标签: java android android-pendingintent