Code example for AccessibilityEvent

Methods: getPackageName

0
	 
	public static final String TAG = "volumeMaster";
 
	@Override public void onAccessibilityEvent(AccessibilityEvent event) { 
	Log.v(TAG, "***** onAccessibilityEvent");
	Toast.makeText(getApplicationContext(), "Got event from: " + event.getPackageName(), Toast.LENGTH_LONG).show(); 
	} 
 
	@Override public void onInterrupt() { Log.v(TAG, "***** onInterrupt"); }
 
	@Override public void onServiceConnected() {  
                Toast.makeText(this, "onServiceConnected Notification...", Toast.LENGTH_LONG).show();
 
            System.out.print("***** onServiceConnected");
		Log.v(TAG, "***** onServiceConnected");
		AccessibilityServiceInfo info = new AccessibilityServiceInfo(); 
		info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED; 
		info.notificationTimeout = 100; 
		info.feedbackType = AccessibilityEvent.TYPES_ALL_MASK; 
		setServiceInfo(info);
		}