I am trying to write an app that will launch an external app via an Intent, then immediately have my app close.
But it seems like my app is not fully closing because sometimes when I rerun my app, it appears to skip over my app's UI and go directly to the screen of the external app I invoked with the Intent.
I set a breakpoint to see what's going on, and this jumping directly to the external app is not because my app is re-invoking the intent again. It seems like my app is just moving to the background and doesn't fully unload/close after it does the intent launch. So when I click my app's icon again, it simply comes to the foreground and jumps directly to the last "state" it was in, and that last state was displaying the external app.
So, after invoking an intent, what is the recommended code to make sure my app fully unloads after the intent so it will properly start from the beginning on it's next launch?
But it seems like my app is not fully closing because sometimes when I rerun my app, it appears to skip over my app's UI and go directly to the screen of the external app I invoked with the Intent.
I set a breakpoint to see what's going on, and this jumping directly to the external app is not because my app is re-invoking the intent again. It seems like my app is just moving to the background and doesn't fully unload/close after it does the intent launch. So when I click my app's icon again, it simply comes to the foreground and jumps directly to the last "state" it was in, and that last state was displaying the external app.
So, after invoking an intent, what is the recommended code to make sure my app fully unloads after the intent so it will properly start from the beginning on it's next launch?