title: Android notification PendingIntent open activity per notification click
body: <p>I'm currently doing some notifications for my app. Now I've successfully created a notification but problem is that each of my notification doesn't pass different extras on click.</p>
  
  <p>Well what happen is that I only have a loop that calls the createNotification method per loop and also I assign different ID's for those for the notification to appear in different stack. </p>
  
  <p>here's my code:</p>
  
  <pre><code>private void createNotification(String record_name, String file_path, String status, int id) {
          /*must pass:
          * record_name, (get the record name in DB using the id create a new query method)
          * record_status, (simple part just match if equivalent to ready to download for the JSON data then show notif if true)
          * record_path *full path* (this one can be get using the record name itself add the path and extension name)*/
  
          /*this will jump from the current activity into the target activity class just do some workarounds here*/
          Intent intent = new Intent(this, RecordEditActivity.class);
          intent.putExtra("record_name", record_name);
          intent.putExtra("record_path", file_path);
          intent.putExtra("record_status", status);
          PendingIntent pIntent = PendingIntent.getActivity(this,0, intent, 0); 
  
  
          /*build the notification here this is only supported for API 11. Since we've targeted API 11 there will be no problem on this*/
          NotificationCompat.Builder notify = new NotificationCompat.Builder(this)
                  .setContentTitle(record_name + " is ready for download")
                  .setContentText("Click to view or download recording")
                  .setAutoCancel(true)
                  .setSmallIcon(R.drawable.notif_icon)
                  .setLargeIcon(BitmapFactory.decodeResource(this.getResources(), R.drawable.ic_launcher))
                  .setTicker("Echo: your file is ready for download")
                  .setContentIntent(pIntent); 
  
  
          NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  
          if(Build.VERSION.SDK_INT&lt;16){
              /*build notification for HoneyComb to ICS*/
              notificationManager.notify(id, notify.getNotification());
          }if(Build.VERSION.SDK_INT&gt;15){
              /*Notification for Jellybean and above*/
              notificationManager.notify(id, notify.build());
          }
  
      }
  </code></pre>
  
  <p>I think the problem is in the <code>PendingIntent</code> part since I don't know which flags should I use for this but I'm not that sure about it.</p>