Android - open or restart app after clicking push notification using flag activities
You need to set the Intent flags on the Intent
. You were specifying them in the call to get a PendingIntent
. Try this:
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_SINGLE_TOP |
Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
notificationIntent, 0);