سؤال

I know my questions sounds like a tongue twister. Anyway I wanted to implement it but I don't have any idea on how to do it. I already know on how to use a FragmentActivity and add the TabHost for it but now what I have is a fragment that should also contain a Tab which also has a fragment. To give it a more detail here's what I wanted to implement:

enter image description here

What I tried so far is to Create a new FragmentActivity which will be contained inside a FragmentActivity and I got a ClassCastException. Any ideas on how can I achieve this?

هل كانت مفيدة؟

المحلول

Using a newer version of the Support Library, or native Fragments if you only care about Honeycomb, you can add Fragments as children of other fragments.

You can call getChildFragmentmanager() inside one of your top level Fragments and add your child Fragments there.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top