I have implemented a DeeplinkActivity to catch the intent-filter data scheme and open an activity. The issue I am having is the app is already open in the background and then the user clicks a deep link to open the home screen activity. If the user presses back to get out of the app it will go to what was running in the background. I wanted it to just back out of the app.
I have tried this.
Intent intent = new Intent(this, LaunchActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
But this does not work. Any suggestions?
FLAG_ACTIVITY_CLEAR_TASK
is what you're looking for? – Dudek