My app has notifications, which - obviously - without any flags, start a new activity every time so I get multiple same activities running on top of each other, which is jus
I had a similar issue after adding notifications as found on the android training site. None of the other answers here worked for me, however this answer did work for me. Summary:
final Intent notificationIntent = new Intent(context, YourActivity.class);
notificationIntent.setAction(Intent.ACTION_MAIN);
notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);