Android Activity Backstack Management
My app shows some content (video,pdf,img, etc ) and within every content I can start another content. What I want is to have only 'one back history'. For example, if my activity hi
Solution 1:
Each activity has activity lifecycle methods you can override to achieve the result you need. Thus, you can either launch Activity2 onResume() on Activity1 onPause(),
http://developer.android.com/training/basics/activity-lifecycle/index.html
or, invoke ActivityManager to detect and manage the other activities.
http://developer.android.com/reference/android/app/ActivityManager.html
You can also make use of intent resolution mechanism to assign several priorities to your activities and then setup intent filters in each activity so you can start activities with a given priority in your code. You can do this either in Java or XML (though I suggest Java). Have a look at the Intent class.
Post a Comment for "Android Activity Backstack Management"