title: Making it so a custom dialog pops up on notification icon click
body: <p>I'm trying to make it so a custom dialog box pops up each time that I click my apps notification icon on the status bar. But I can't get it to work. Here's my notification icon code. I also don't want it to return to the main activity every time I click it.</p>
  <pre><code>    NotificationManager nm=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
      Notification notification=new Notification(R.smiley_face, &quot;Lala&quot;, System.currentTimeMillis());
      Context context=MainActivity.this;
      PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), Notification.FLAG_ONGOING_EVENT);        
      notification.flags = Notification.FLAG_ONGOING_EVENT;
      notification.setLatestEventInfo(this, &quot;Smiley&quot;, &quot;Touch for more options&quot;, contentIntent);
      Intent intent=new Intent(context,MainActivity.class);
      PendingIntent  pending=PendingIntent.getActivity(context, 0, intent, 0);
      nm.notify(0, notification);
  </code></pre>
  <p>And here is the custom dialog code. I've tried putting it in the notification icon code but it doesn't work.</p>
  <pre><code>                CustomDialogClass cdd = new CustomDialogClass(MainActivity.this);
          cdd.show();
  </code></pre>
  <hr />
  <h3>Solved</h3>
  <p>What I ended up doing was just making the customdialog into a transparent activity and then starting it up as an intent.</p>