質問

Is there anyway to know what notification have been removed? When I call this code:

@Override
public void onServiceConnected() {
    AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
    info.notificationTimeout = 1;
    info.feedbackType = AccessibilityEvent.TYPES_ALL_MASK;
    setServiceInfo(info);
}

@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    String s = event.getText()+"";
    Log.d(TAG, s);
}

I only got Notification dissmised, but this don't tell me which notification was dismissed.

役に立ちましたか?

解決

You should use NotificationListenerService for this purpose (To catch Notification of application NotificationListenerService is another option like Accessibility Service).

Where onNotificationRemoved gives StatusBarNotification into parameter. By reading this param you can get all information about notification.

You can read NotificationListenerService-Example for more details.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top