My problem is the following. When I start my application from the launcher, I want it to be always started from main activity, but only when it was cleaned from memory by android.
For example I have activities A (main activity) and B. When I launch my app and go to the B, and press home button, and just after this launch my app again, I want it to start B, like it do now. But if I press home button from B, and left the app in background for some time (or for example clean up memory manually with some memory cleaner app) and my activities get killed, I want my app to start again from main activity, not from activity B. How can I achieve this?
I browsed the net but the only thing I have found is clearTaskOnLaunch="true"
declaration in manifest. But this is not what I want, because it starts app from main activity even if Android hasn't clean upped activities.