Hi guys, I am working on an Android application where I want to implement a group of actions for each tab. But since the activity group is out of date, I have to use fragments. In the past days, I searched Google and did some research on this topic, but I still don't get it. The following figure shows what I want to do. I also go straight from iOS, and I need feedback on my theories.

As you can see, each fragment consists of a WebView fragment. When the user clicks on the link in this WebView fragment, the request falls in and replaces a new fragment, which again contains the WebView and loads the link that was clicked in the previous fragment. At some point, the user decides to return to the first fragment and presses the "Back" button.
Fragments should push the stack in the reverse order until it sees the first again. Ideally, each fragment should preserve its instancestate, so when the user returns, WebView does not need to load the site again.
I came across an ActionBar Sherlock, which provides an example of fragment tabs. There is also an example fragment fragment. It would be ideal to combine these two examples, so that each tab consists of a Fragment stack.
My code structures are as follows:
My TabHost snippet
public class MyActivity extends SherlockFragmentActivity { static TabHost mTabHost; static TabManager mTabManager; public static int THEME = R.style.Theme_Sherlock_Light; @Override protected void onCreate(Bundle savedInstanceState) { setTheme(THEME);
What will the stack of fragments for each tab look like? I currently have a Fragment Activity with a fragment inside each tab. But I do not reach the logic that I need.
Here is my code: My snippet with WebView inside
I would be happy for some feedback and tips (or are there any examples on the Internet?). I also have some memory issues - when the user clicks and clicks and clicks, and the memory must hold each fragment on the stack.
Greetings.
Bins ich
source share