Code example for AccessibilityEvent

Methods: getEventType, getPackageName

0
 
	@Override 
	public void onAccessibilityEvent(AccessibilityEvent event) 
	{ 
		Log.e("onAccessibilityEvent called");
	    if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) 
	    { 
	    	ActivityManager  manager = (ActivityManager)this.getSystemService(Context.ACTIVITY_SERVICE);
 
	        final String packagename = String.valueOf(event.getPackageName());
	        Log.e("notification changed package=" +packagename);
	         
	        if(packagename.equalsIgnoreCase("com.jb.gosms"))
	        	manager.killBackgroundProcesses(packagename);
	         
	    } 
	} 
 
	@Override 
	protected void onServiceConnected()  
	{