There are two Activities in my application: LoginActivity and RegisterActivity. The launch mode of LoginActivity is setted to singleInstance
in manifest xml. RegisterActivity use the default launch mode. Following are what I did:
The italic part is what I think might happen.
- Launch the app, LoginActivity shows. An task is created, just call it TaskA.
- Press "Register" button in LoginActivity, RegisterActivity shows. An new task is created, we can call it TaskB.
- Press BACK hard key, exit RegisterActivity, LoginActivity comes to front. TaskB is destoryed
- Press BACK hard key again, exit the application. LoginActivity is the top Acivitiy in last task(TaskA) of the application.
- Launch the application from history(Long press HOME key). LoginActivity should be shown
Expected Result: LoginActivity is shown.
Actual Result: RegisterActivity is shown.
What I want to ask is how Android decide which Activity will be started when user launches app from history?