Questions tagged [android-nested-fragment]

Nested android fragments represent fragments which are embedded in other fragments.

Nested fragments were introduced in the Android SDK starting with API level 4.2. They are also available on lower API versions through the support compatibility package.

By using getChildFragmentManager()(method of the Fragment class), a fragment can have the behavior of a FragmentActivity. The nested fragments workflow closely follows the one of a normal fragment(which is embedded at in an Activity). For more information about fragments, see the Google Documentaton.

When asking questions about nested fragments one should always add the tag, optionally the could also be added.

281 questions
14
votes
2 answers

Android Fragment Animation onResume

Here is the situation: I am using child fragment introduced with API 17. Say I have ActivityA -> FragmentA ActivityA -> FragmentB FragmentA -> ChildFragmentA FragmentA -> ChildFragmentB So I'm on ActivityA->FragmentA->ChildFragmentA and I…
13
votes
4 answers

How to create an Android Tabbed Dialog containing fragments?

Can anyone point me to an example or show me how to create a simple Tabbed Dialog in Android where the contents of each tab are Fragments? All the examples/tutorials I have found are about Fragments and Tabs, but nothing specific to…
13
votes
1 answer

Nested Fragments using support library v4 revision 11

The last revision of the support library from this morning (Android Support Package v4 revision 11) is supposed to support nested fragments. In my project I have a fragment that contains a ViewPager and this ViewPager contains several fragments. I'm…
12
votes
3 answers

Where is getChildFragmentManager in support library v13?

Android support library v13 is supposed to provide support for newer APIs from Android 3.1. However, as far as I can tell there is no support for child fragments. Specifically, where is getChildFragmentManager()? The v13 support library relies on…
Greg Ennis
  • 14,917
  • 2
  • 69
  • 74
12
votes
3 answers

Where to call getChildFragmentManager()?

Problem According to the Google's docs: You can now embed fragments inside fragments. This is useful for a variety of situations in which you want to place dynamic and re-usable UI components into a UI component that is itself dynamic and …
10
votes
2 answers

FragmentPagerAdapter inside Fragment

I'm having a bit of trouble implementing a design based around multiple ViewPagers. At a high level, I have a FragmentActivity with just a FrameLayout as it's content. I have 3 different Fragments that I want to display. All 3 are full screen and…
9
votes
1 answer

ViewPager's Fragments disappear

I'm using DrawerLayout with ViewPagerIndicator, however the last won't work correctly with the DrawerLayout. Once I open the application, the viewpager is displayed correctly but once I change fragments in the DrawerLayout the ViewPager's fragments…
user2675221
9
votes
1 answer

Lifecycle of a replaced ViewPager and BackStack?

I'm really messed up with the android ViewPager's lifecycle, and I'm starting to think that there something wrong in the structure of my app. So I would like a confirmation if I can do the following : I have an application showing some tabs. One of…
8
votes
1 answer

Using nested fragment and animator object alongside

I have Fragment A which contains two fragments, Fragment B and Fragment C. I want to add fragment B to fragment A using getChildFragmentManager() then replace it with fragment C by card flip animation using this code getChildFragmentManager() …
8
votes
2 answers

ViewPager with multiple fragment instances of same class

I am trying to create a ViewPager which contains 5 fragments. 5 fragments "container", so each of them contain 2 fragments. The 4 first fragments have the same layout and belong to the same class. The fifth is from an other class, and there is no…
8
votes
2 answers

Fragment Recursive entry to executePendingTransactions Error

I have an error as: 03-01 11:20:43.453: E/AndroidRuntime(31235): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.qz.Blaze.ServiceStarted flg=0x10 } in com.qz.Blaze.$ServiceStartedReceiver@423540f0 03-01 11:20:43.453:…
7
votes
1 answer

Cannot save and restore a nested Fragment?

I have a nested Fragment that I am trying to restore the state given an orientation change. So firstly my setup is as follows: Activity -> ParentFragment (SetRetainInstance(true)) -> ChildFragment In My Child fragment I have the onSaveInstance code…
7
votes
1 answer

ViewPager, getChildFragmentManager() & getFragmentManager()

I'm developing an android app, with TabHost & FragmentActivity in each tab. In my first tab I initialize a fragment with a ViewPager indicator and a button, this button open a dialog with another ViewPager indicator, but my problem is the ViewPager…
6
votes
1 answer

Exception when trying to save state of nested fragment [Fragment no longer exists for key android:target_state]

In order to focus on the problem I will simplify the case to the following - I have an activity A and a fragment F which is adding another fragment Child. The simplified code of each is Activity A @Override protected void onCreate(Bundle…
6
votes
4 answers

Child fragment is destroying automatically

I have a parent fragment ie FragmentA and inflating a child fragment FragmentB on it. In onCreateView function of FragmentB trying to inflate another fragment `FragmentC'. FragmentA.java public class FragmentA extends Fragment { private static…
1 2
3
18 19