I have a deep link to a transparent activity that interacts with the Play Billing Library (opens the system purchase bottom sheet).
There are two situations in which this deep link can be opened:
- when the app is opened, or;
- when the app is not opened.
If the app is not opened I want to add the "HomeActivity" to the backstack before executing any other action.
What is the most correct way to do that?
You can achieve this by handling the deep link in your app's manifest file and specifying the appropriate launch mode for the transparent activity to be opened. You can also consider using TaskStackBuilder to manage the back stack. Here's a sample code snippet:
For more details, you can refer to the Android developer documentation on handling deep links: Handle Deep Links
Also, check out the TaskStackBuilder documentation for managing the back stack: TaskStackBuilder