In my app I have couple activities. How to setup that every time user long press home and bring from background my app it display always main activity?
Cause right now if user hide the app and log press “home” button, my app coming back to the latest open activity, but then user press “back” button it close app, but than press app icon it coming back to main activity.
If you want only your main activity to be in visible your “recent apps”, then in all your non-main activities, add this flag in your manifest:
This will cause your main activity to remain on the activity stack, but remove all your activities from it.
http://developer.android.com/guide/topics/manifest/activity-element.html#nohist