I’ve created a custom navigation bar for my application. One of the things it (currently) does is allow you to switch between various activities in the application. One part I still have yet to solve fully is how to keep the navigation bar constant on the UI while the view above it switches to another activity.
This google groups thread seems to ask this very question and the solution seems to revolve around using a LocalActivityManager to add the Window decor of the new activity to a ViewGroup of your current layout. I’m curious if anyone has done this before and what their thoughts were?
In particular I’d be interested in the pros/cons of the LocalActivityManager/multiple activities approach vs one super activity which switches multiple views (rather than activities).
I would guess that Fragments would be the recommended way to accomplish this now: http://developer.android.com/guide/topics/fundamentals/fragments.html They have a lifecycle like activities but are meant to be added and removed from layouts. With the compatibility library (http://android-developers.blogspot.com/2011/03/fragments-for-all.html) you can use them all the way back to OS v1.6. As a bonus this is the way that the OS has been moving in terms of reusable UI components since v3.0, so you should be in better shape for the future.