【问题标题】:Get contentintent of Notification at onNotificationPosted in NotificationListenerService?在 NotificationListenerService 中的 onNotificationPosted 处获取通知的内容意图?
【发布时间】:2015-03-11 12:01:03
【问题描述】:

有什么方法可以在通知发布后检索它的pendingintent 吗?我使用NotificationListenerServiceonNotificationPosted(statusbarNotification sbn) 来检索基本通知信息,例如代码文本和通知标题,这些信息通常由另一个应用程序发布。有什么方法可以通过调用setContentIntent检索通知中设置的contentintent

我是新来的,如果我做错了什么,请原谅我;)

【问题讨论】:

    标签: android notifications listener android-notifications


    【解决方案1】:

    是的,这是可能的。

    获取 StatusBarNotification 的通知。然后访问 contentIntent 属性。

    Notification n = sbn.getNotification();
    PendingIntent intent = n.contentIntent;
    

    【讨论】:

      猜你喜欢
      • 2013-08-05
      • 2014-03-25
      • 1970-01-01
      • 2020-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多