我添加了一个AccessibilityService来获取通知消息。
我现在确实收到了所有通知消息。
我的问题是:有没有办法在下面的代码中获取 PendingIntent 中的操作 url?
if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED)
{
Parcelable data = event.getParcelableData();
if (data instanceof Notification) {
Notification notification = (Notification) data;
PendingIntent nit = notification .contentIntent;
try {
//after i invoke nit.send, it will goto the target app and open the right news.
nit.send();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
那么有没有办法从 PendingIntent 中获取新闻 URL 呢?