Would you be looking for the following flags to add to the Intent you start the other application with:
Android How to clear stack of an application if its open before launching by another appliction?
-
30-05-2022 - |
Question
i am launching another application through my application,so i want to check is any instance of that application is already in stack or not? if exist then clear all instance before launch.
Solution
OTHER TIPS
Try adding this flags to your intent
Intent intent= getPackageManager().getLaunchIntentForPackage("com.package.address");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow