0

I have an application with a tabhost and one of the tabs is a ActivityGroup. I want to navigate from Activity A1 in ActivityGroup GroupA to Activity B2 in ActivityGroup GroupB. The main activity in GroupB is B1, but i want to go directly to B2.

I don't know how I can actually receive the ActivityGroup B object from my TabHost.

I can go to GroupB by using setCurrentTab(int index) on the TabHost. But how can I get to Activity B2?

dumazy
  • 13,857
  • 12
  • 66
  • 113

1 Answers1

1

Probably this is not a direct answer to you problem, but I'd rather suggest you start using fragments instead of ActivityGroups and a lot of Activities. Using fragments in this case has a lot of benefits:

  1. You can implement a TabHost with Fragments in it instead of Activities. There are samples in Android SDK and in ActionbarSherlock lib on how to implement this. You can also add tabs with Fragments to actionbar.
  2. Replacing fragments in tabs can be easily done with FragmentTransaction class. You won't need to store references to ActivityGroups and write spaghetti code to control activities in tabs.
  3. A lot of activities in tabs and ActivityGroups can lead to OutOfMemoryExceptions.
  4. You can easily switch you Activities in tabs to Fragments.
  5. ActivityGroup is deprecated.
atermenji
  • 1,338
  • 8
  • 19