title: handle different types of notifications in android
body: <p>I have 3 types of notifications in android.Audio/Video call and msg. How to differentiate based on notification type and open different activity on different notification. THis is hoW I open activity on click of notification.</p>
  
  <pre><code> private void sendNotification(long when,String msg) {
      String notificationContent ="Notification Content Click Here to go more details";
      String notificationTitle ="This is Notification";
      //large icon for notification,normally use App icon
      Bitmap largeIcon = BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher);
      int smalIcon =R.drawable.hcp;
      String notificationData="This is data : "+msg;
  
      /*create intent for show notification details when user clicks notification*/
      Intent intent =new Intent(getApplicationContext(), NotificationDetailsActivity.class);
      intent.putExtra("DATA", notificationData);
  
      /*create unique this intent from  other intent using setData */
      intent.setData(Uri.parse("http://www.google.com"));
      /*create new task for each notification with pending intent so we set Intent.FLAG_ACTIVITY_NEW_TASK */
      PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
      Log.d(TAG, "Preparing to send notification...: " + msg);
      mNotificationManager = (NotificationManager) this
              .getSystemService(Context.NOTIFICATION_SERVICE);
  
  
  
      NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
              this).setSmallIcon(R.drawable.hcp)
              .setContentTitle("GCM Notification")
              .setContentIntent(pendingIntent)
              .setAutoCancel(true)
              .setSmallIcon(smalIcon)
              .setTicker(notificationTitle)
              .setLargeIcon(largeIcon)
              .setContentText(notificationContent)    
              .setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
              .setContentIntent(pendingIntent);
      ;
      Notification notification=mBuilder.build();
  
      mBuilder.setContentIntent(pendingIntent);
      mNotificationManager.notify((int) when, notification);
  
      Log.d(TAG, "Notification sent successfully.");
  }
  </code></pre>