You need to set the launchMode
attribute of the Activity
you are starting to singleTop
. This will cause incoming Intents to be delivered to the existing instance rather than starting a new instance when that Activity
is already at the top of the task’s stack.
This is done in the manifest by adding android:launchMode="singleTop"
to the <activity>
element. To access the latest Intent (if you are interested in any data that may have passed in with it), override onNewIntent()
in your Activity
.