2
votes

As far as I have been looking around, I have come up with no good final solution for my code. I am trying to implement something like this layout:

ActionBar

 ----Tab 1 ---Fragment 1 - Fragment 2
 ----Tab 2 ---Fragment 3 - Fragment 4
 ----Tab 3 ---Fragment 5 - Fragment 6

My problem is that when I access Fragment 2 from Fragment 1, two things may happen depending the implementation. A)Content from fragment 1 is still on screen. B)When I access Tab 2 from Fragment 2, content from Fragment 2 is still visible and, when I press again Tab1, content from Tab2 is still on screen.

I know it may not make complete sense, but I've tried nested fragments implementation, and some custom backstack implementations, but I can't get to understand how to make this right.

To be more precise, I can't "come back" properly from Fragment 2 to Fragment 1. I can't switch to Tab2 from Fragment 2 and then go back to Tab1 (Fragment1).

Can anyone help me? The implementation of the actionbar with three simple fragments (no inner fragments) worked perfectly.

Here are some of my previous inputs:

1

1 Answers

0
votes

I was looking for a similar example and found that there is a good one in the android SDK called Honeycomb Gallery. I think its in the SDK 3.0+ API examples. You can use your SDK manager to download that package and then you can create a sample project and choose Honeycomb Gallery(assuming you are using eclipse).