Code example for AccessibilityEvent

Methods: getParcelableData

     * @param event The event to extract from. 
     * @return The extracted Notification, or {@code null} on error. 
    private Notification extractNotification(AccessibilityEvent event) {
        final Parcelable parcelable = event.getParcelableData();
        if (!(parcelable instanceof Notification)) {
            return null; 
        return (Notification) parcelable;
     * Manages the notification history and returns whether a notification event 
     * is recent. Returns false if the {@link AccessibilityEvent} does not 
     * contain a {@link Notification}. 
     * @param notification The notification.