title: android How to start activity when user clicks a notification?
body: <p>I wanna open activity when user clicks a notification. I know this question is duplicated but couldn`t find a solution here is what i did </p>
  
  <pre><code>NotificationCompat.Builder mBuilder =
  new NotificationCompat.Builder(this)
  .setSmallIcon(R.drawable.notification_icon)
  .setContentTitle("My notification")
  .setContentText("Hello World!");
  
  Intent resultIntent = new Intent(this, ResultActivity.class);
  
  // Because clicking the notification opens a new ("special") activity, there's
  // no need to create an artificial back stack.
  PendingIntent resultPendingIntent =
      PendingIntent.getActivity(
      this,
      0,
      resultIntent,
      PendingIntent.FLAG_UPDATE_CURRENT
  );
  
  mBuilder.setContentIntent(resultPendingIntent);
  // Sets an ID for the notification
  int mNotificationId = 001;
  // Gets an instance of the NotificationManager service
  NotificationManager mNotifyMgr = 
      (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  // Builds the notification and issues it.
  mNotifyMgr.notify(mNotificationId, mBuilder.build());
  </code></pre>
  
  <p>Here is <a href="http://developer.android.com/training/notify-user/build-notification.html" rel="nofollow">documentation</a> i followed. Does anyone have any idea? why ResultActivity couldn't open?</p>