Here's the deal. I have an application with three tabs. Through various interactions with the items in the tabs I end up launching other activities. The client has reviewed this and would like the activities launched "within" the tabs, so the tabs remain visible and if the user clicks the tab it goes back to the original activity defined in the setContent function. Is this possible and how would I go about this from other activities? (ie the child activities, not the one that defines the TabHost and has access to call setContent)?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
Here is my solution
Launch tab
Call next activity
Call next again
Works on emulator 2.2
commonsware.com is correct, it's not possible. I had a similar issue, but it was only 1 activity which was being launched. I sacrificed a little of my architecture and deleted the activity which was launched from inside the tab. I put the code in a View and then I added a ViewAnimator to the tab's activity. I overrode the back button and remove that view if it's up, or else let the back button perform as normal.
This faked it well enough, and for only 1 closely-related activity, I'm not going to lose any sleep over the design considerations.
you can use
for each activity you set as a content for tabSpec, and it will create this activity each time you press on the tab
It is possible to launch activities within tabs. Therefore set the tabspec content to an ActivityGroup instead of a regular Activity.
From within that ActivityGroup you can then start another Activity like this that only updates the contentview of the tab you're in.
How about 2 tabbar in this problem. First 1 is menu bottom tabbar, second one is top tabbar, they are different activity and xml
As I can open a fragment or activity from a spinner in the toolbar ?