문제

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