in my applications root activity, I have a customized tab bar, containing three tabs to switch between three screens implemented using ViewFlipper.
What I now want to do is to give each of those screens it's own activity stack, making the tab bar available in all of my activities, and switching between the different stacks when pressing a tab.
Works like a charme on honeycomb, where I have bringTaskToFront() available in ActivityMaganger class.
I tried many solutions, e.g.:
- restarting the top activity of the specific task in the hope that the task will move to front
- getting the honeycomb classes in somehow
So, any idea ?
Many thanks,
Sven
In versions honeycomb and up, you can use MoveTaskToFront like so
Make sure your Project Compiles with Android v.11 or up sothat this line doesn't break with compile:
am.moveTaskToFront(rt.get(i).id, ActivityManager.MOVE_TASK_WITH_HOME);
For older Android versions you can use the following to move the task to the front:
In the android manifest add the following
And then lastly, Make sure when you push the task to back by overriding the
onBackPressed()
, DO NOT USEmoveTaskToBack()
, It will result in your task not ending up visible to the user. Rather use the following: This will simulate a home button press which will effectively hide your application and show the home screenAnd there you go, I hope this works for you and helps a few people with this problem.
This works for me on android versions above and below Honeycomb. The keys are the intent flags