title: How to compare AccessibilityNodeInfo?
body: <p>I have written an Android app using AccessibilityService. This means: when a text appears <strong>"xxx"</strong>, it auto clicks it and auto closes. But when I scroll my window or something changed in the window it clicks and closes again.</p>
  
  <p>So I printed <code>accessibilityNodeInfo.toString()</code> in Logcat, but the same <code>accessibilityNodeInfo</code> returns different strings. I'll show the code to clarify what I mean:</p>
  
  <pre><code>AccessibilityNodeInfo previousAccessibilityNodeInfo = null;
  
  mAccessibilityNodeInfo = event.getSource();
  
  if (mAccessibilityNodeInfo == null) {
          return;
      }
  
  if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED) {
      List&lt;AccessibilityNodeInfo&gt; accessibilityNodeInfos
              = mAccessibilityNodeInfo.findAccessibilityNodeInfosByText("xxx");
          if (accessibilityNodeInfos != null &amp;&amp; accessibilityNodeInfos.size() &gt; 0) {
              AccessibilityNodeInfo info = accessibilityNodeInfos.get(accessibilityNodeInfos.size() - 1);
              Log.d(TAG,info.toString());
              if (previousAccessibilityNodeInfo == null) {
                  previousAccessibilityNodeInfo = info;
                  info.getParent().performAction(AccessibilityNodeInfo.ACTION_CLICK);
              }
              else if (previousAccessibilityNodeInfo != null &amp;&amp; previousAccessibilityNodeInfo != info) {
                  info.getParent().performAction(AccessibilityNodeInfo.ACTION_CLICK);
              }
              else {
                  return;
              }
  
          }
  
      }
  </code></pre>
  
  <p>// Log info: The same <code>AccessibilityNodeInfo</code> when I scrolled returns different strings.</p>
  
  <pre><code>accessibility.AccessibilityNodeInfo@36eea0;
  accessibility.AccessibilityNodeInfo@38443e;
  accessibility.AccessibilityNodeInfo@3999dc;
  accessibility.AccessibilityNodeInfo@3aef7a;
  accessibility.AccessibilityNodeInfo@3c4518;
  </code></pre>
  
  <p>//  In the above code is the same <code>AccessibilityNodeinfo</code></p>
  
  <p>So how should I compare AccessibilityNodeInfo? Achieve such results that as soon as return if it is a previous marked AccessibilityNodeInfo.</p>
  
  <p>Sorry for my bad English.</p>