title: How to compare two Intents for equality
body: <p>Right now I have a <code>LinkedList</code> of Intents in an <code>IntentService</code> that keeps track of what Intents are enqueued by the <code>Service</code>. I'm finding that the <code>contains()</code> method is never returning true, even for identical Intents. Is there something else I have to do to compare two Intents?</p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, int flags, int startId) {
      if(queue.contains(intent)){
                      //Never reaches here
          intent.setAction(NO_ACTION);
      }
      queue.push(intent);
      return super.onStartCommand(intent, flags, startId);
  }
  </code></pre>
  
  <p>Example code for sending an Intent:</p>
  
  <pre><code>    Intent i = new Intent(context, NodeIndexService.class);
      i.setAction(NodeIndexService.REFRESH);
      i.putExtra(NodeIndexService.TYPE, indexType);
      i.putExtra(NodeIndexService.RESULT_RECEIVER, receiver);
      context.startService(i);
  </code></pre>
  
  <p>Two Intents being sent one after another with this code should be identical, no? The context isn't changing, and the extras are the same as well.</p>