Code example for AccessibilityEvent

Methods: getEventType, getPackageName, getText

0
    } 
 
    @Override 
    public void onAccessibilityEvent(AccessibilityEvent event) {
 
        if (event.getEventType() == TYPE_NOTIFICATION_STATE_CHANGED) {
            event.getText();
            Log.d(LOG_TAG,
                    format("Receive notification from %s with content %s", 
                            getApplicationName(event.getPackageName().toString()),
                            getEventContent(event.getText())));
        } 
 
    } 
 
    @Override 
    public void onInterrupt() { 
        Log.d(LOG_TAG, "Interrupt");
    } 
 
    @Override