I don't want to start activity when user clicks on notification in status bar when activity A is showing, but when A has been destroyed or invisiable, activity has been start normally when user click a notification.
How can I do? Thanks!
Update, this is my code to show Notification:
Intent notificationIntent = new Intent(context, MainActivity.class);
notificationIntent.putExtra(GCMReceiver.EXTRA_NOTIFICATION_MESSAGE,
notiMessage);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this.context);
mBuilder.setContentText(message);
mBuilder.setContentTitle(title);
mBuilder.setAutoCancel(true).setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent);
mNotificationManager.notify(KEY_PUSH_NOTIFICATION, mBuilder.build());