Let's take an example:
Scenario: I am trying to book a movie ticket using a mobile application and at the time of payment, the app provides me to select any of the payment apps (already installed in my phone) to complete the payment. I select my mobile app, which is a payment app and it gets opened inside the movie ticket booking application.
Problem Statment: The problem is that if my payment app's instance is already running inside the movie ticket booking application, and I minimize it and go launch my payment app separately, it still opens leaving me with two instances running:
- My payment app running inside the movie ticket booking app.
- My App running separately.
I want that at a time only one instance should live and if someone launches the app separately it should get redirect to the living/running instance.
Note: I have tried using android:launchMode="singleTask" but still facing the issue.