I am implementing the solution for TabActivity with activities in the TabHost as described at http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html. I realize this is sub-optimal but I am already down this road pretty far and have only one remaining hiccup. I have a need to pop to the top of the stack that I am managing (using a list of String for activity ID) and I know that I can get this activity using:
Activity current = getLocalActivityManager().getActivity(mIdList.get(0));
However, I do not know of a method for “showing” current.
I know that I can do this:
Activity current = getLocalActivityManager().getActivity(mIdList.get(1))
current.finish();
And this will have the desired result in the case of there being at least two activities on the stack. However, when there is only one, it fails very badly with an ArrayOutOfBoundsException.
How can I “show” a given activity?
Try this way to start an activity which is always at the top in Activity Stack: