In my app, I have a custom made tab control and handle showing the content that corresponds to a tab when a tab is tapped. Each tab is also associated with an activity. However, the content for that activity is only the section of the screen that shows the tab's content.
I have a view for the tab's content that essentially acts as a container. At the moment, when you select a tab, I programmatically set the visibility of all the views within this container to GONE, making them invisible and then set the visibility of the currently selected view to VISIBLE. This all works but it leaves me wondering about what Google's documentation refers to as "embedded activities".
I was under the impression that once I launched one of these embedded activities, the content associated with that activity would come to the foreground and the content from the last activity would go behind it, essentially making it invisible. And when this activity is closed, the content associated with that activity would disappear and then the previous activity would show along with its content. In other words, Android handles the switching of content in relation to its activity.
As it stands, I am manually setting the visibility of each view. Normally, if an activity has content that takes up the entire screen and then the activity closes, the entire content disappears and the UI reverts back to the last activity and its content. But I am dealing with multiple activities sharing the same section of the screen which is only a portion of the screen. Maybe the terminology "embedded activities" is incorrect but that comes straight from Google's documentation. Maybe I just don't understand how views and embedded activities are suppose to interact.
I should also point out that I would prefer to find a solution that works with Android 1.5. I came across something called Fragments that might be what is used to handle automatic creation and destruction of views but I am not sure. Even if it did, it's for Honeycomb. Currently I am using ActivityGroup to handle multiple activities but just came across the documentation that says its deprecated.