title: How to click button in settings using AccessibilityService?
body: <p>I want to click button in android settings using AccessibilityService like greenify did, but I cannot find the specific button. please help me.</p>
  
  <p>MyAccessibilityService .java:</p>
  
  <pre><code>public class MyAccessibilityService extends AccessibilityService {
  
      private static final String TAG = MyAccessibilityService.class
              .getSimpleName();
  
      @Override
      public void onAccessibilityEvent(AccessibilityEvent event) {
          Log.i(TAG, "ACC::onAccessibilityEvent: " + event.getEventType());
  
          //TYPE_WINDOW_STATE_CHANGED = 32, 
          if (AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED == event.getEventType()) { 
              AccessibilityNodeInfo nodeInfo = event.getSource();
              Log.i(TAG, "ACC::onAccessibilityEvent: nodeInfo=" + nodeInfo.getText());
  
              List&lt;AccessibilityNodeInfo&gt; list = nodeInfo.findAccessibilityNodeInfosByViewId("com.android.settings:id/left_button");
              for (AccessibilityNodeInfo node : list) {
                  Log.i(TAG, "ACC::onAccessibilityEvent: " + event.getEventType()
                          + " " + node);
              }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Only when type is TYPE_WINDOW_STATE_CHANGED , I could get the nodeInfo object.</p>