I have two Activities FirstActivity and SecondActivity.
FirstActivity has an intent filter MAIN, LAUNCHER and DEFAULT. SecondActivity is just a normal activity and n
It is the correct behavior.. if you start the application through "Recent Application" it will point from the last activity. Try launching it through normal application list
For your main Activity try to set the lauch mode as "singleInstance" in the AndroidManifest file. for second activity set "Finish On Task launch" to true.
you can call your second activity with the flag set no history like this,
intent1.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
This has worked for me several times.
Read from the Android Doc
In Second scenario i think activity stack is empty as app is closed . so now you are starting activity2 , means this is the only activity in stack . now desired back behavior can be possible by overriding onbackpress and start activity1 if its second scenario .
When you start application from 'Recent Application' shortcut, it will launch the last activity. So you can try to launch the application from the application list, see whether it solves your problem.