You need to make sure that the activity with Dialog theme has a different task affinity than the rest of your app. Otherwise, if your app is running, launching that activity (even with FLAG_ACTIVITY_NEW_TASK
) will just bring the existing task forward and put your activity on top of that.
You should add the following to the manifest for this specific activity:
android:taskAffinity=""
android:noHistory="true"
android:excludeFromRecents="true"
NOTE: Setting noHistory
and excludeFromRecents
ensures that this task does NOT show up in the "recent tasks list".