How to make notification intent resume rather than making a new intent?

The idea is that people can navigate
away from this activity and quickly
access it again from any screen they
want by pulling down the drop down
menu and selecting it.

Please make this optional.

However, when the notification is
pressed it starts a new instance of
the activity.

That will happen by default.

What would i have to change to make it
see if the activity has not already
been destroyed and i can just call
that instance back(resume it) and
therefore not needing to load it again
and won’t need to add another activity
to my stack.

Get rid of FLAG_ACTIVITY_NEW_TASK. Add notifyIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); — see this sample project.

Context context = getApplicationContext();

Please don’t do this. Just use your Activity as a Context.

Leave a Comment