I can get the app ID from my running activity via activity.getTaskId()
. It will report back 185
. If I go to another app, and start my activity from a share button, it will be placed IN THAT apps stack. If I do activity.getTaskId()
it will report back 192
for example. I am assuming that an application process can only have one main task stack associated with it. How do I get that tasks ID? I want to be able to know "Hey I'm running outside of your apps task stack".
I contemplated doing this by polling the taskId the first time my activity is created and set that as a member variable to my Application Class, but if my app is killed, and then started first from another application, it will have the incorrect task id as the "AppTaskStackId". I haven't found any API for this.