I think FLAG_ACTIVITY_CLEAR_TOP
is what you need:
If set, and the activity being launched is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it will be closed and this Intent will be delivered to the (now on top) old activity as a new Intent.
Although if you want to reuse the existing instance of Activity A (via onNewIntent()
) then you might also need to set FLAG_ACTIVITY_SINGLE_TOP
in the intent.