title: Notification onClick
body: <p>I have successfully created a notification thanks to my other <a href="https://stackoverflow.com/questions/12850033/trying-to-build-a-simple-notification-in-android/12850175#comment17389944_12850175">question</a>, using NotificationCompat. I want to now just change what the notification does onClick. I'd really just like to have an alert dialog pop up (I've seen some app's do it) but everytime I click it, I just have my activity show up. Any ideas?</p>
  
  <p>The notification code:</p>
  
  <pre><code>Intent notificationIntent = new Intent(ctx, YourClass.class);
  PendingIntent contentIntent = PendingIntent.getActivity(ctx,
          YOUR_PI_REQ_CODE, notificationIntent,
          PendingIntent.FLAG_CANCEL_CURRENT);
  
  NotificationManager nm = (NotificationManager) ctx
          .getSystemService(Context.NOTIFICATION_SERVICE);
  
  Resources res = ctx.getResources();
  Notification.Builder builder = new Notification.Builder(ctx);
  
  builder.setContentIntent(contentIntent)
              .setSmallIcon(R.drawable.some_img)
              .setLargeIcon(BitmapFactory.decodeResource(res, R.drawable.some_big_img))
              .setTicker(res.getString(R.string.your_ticker))
              .setWhen(System.currentTimeMillis())
              .setAutoCancel(true)
              .setContentTitle(res.getString(R.string.your_notif_title))
              .setContentText(res.getString(R.string.your_notif_text));
  Notification n = builder.build();
  
  nm.notify(YOUR_NOTIF_ID, n);
  </code></pre>