title: How to finish the activity in IntentService in android?
body: <p>I am using GCMIntentService class extend IntentService to get the notification while click the notification i can launch the my activity. Its working but i can't finish my activity so i am facing the back button press problem. </p>
  
  <p><strong>* Below code *</strong></p>
  
  <pre><code>Intent resultIntent = new Intent(this, MainActivity.class);
          resultPendingIntent = PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
          // Set pending intent
          mNotifyBuilder.setContentIntent(resultPendingIntent);
  </code></pre>
  
  <p>In this code while launch the MainActivity and press the back button two times only it exist from app because i can't finish the activity in notification click. So please help me how to finish the activity in GCMIntentService class. </p>