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
1
vote
1 answer

I'm using Viewpager fragment and want to use "ShareActionProvider" on its Nested Fragment..! Is it possible?

there is Viewpager used in my code in which 4 Fragments. when I click on Any Fragment Item it will redirect to another fragment class in which I want Share Action to be used.. But it didn't Support.. @Override public void onCreateOptionsMenu(Menu…
1
vote
2 answers

getChildFragmentManager() and containerId

I create a child fragment in the parent fragment code using getChildFragmentManager(), a containerId, and the method .add(). Then I attempt to replace that childFragment inside the onActivityCreated() method of the childfragment code using…
Lv99Zubat
  • 853
  • 2
  • 10
  • 27
1
vote
1 answer

It's possible to force onActivityResult in fragment?

I have an application like this In FragmentB I have TextView and one Button. The button's function is replace FragmentB with a new Fragment (FragmentB1). In FragmentB1, I show a ListView with Strings. In listView's onItemClickListener, I have to…
Dani Garcia
  • 464
  • 1
  • 6
  • 18
1
vote
1 answer

Nesting fragments inside a viewpager fragment throws IndexOutOfBoundsException

I am using a viewPager which contains 2 fragments. The first fragment contains nested fragments and the second one is an empty fragment. Inside the first fragment I am nesting 4 fragments using the child fragment manager. My app crashes with an…
1
vote
1 answer

A nested fragment is not displayed inside a ViewPager

The attached picture shows a ViewPager with 3 pages. Each page is implemented as a Fragment. The Toolbar has a + icon in black for adding a new patient. When the + icon is pressed, a nested fragment should be created inside the Patients page which…
Amit
  • 519
  • 1
  • 5
  • 20
1
vote
2 answers

Facebook Login from Nested Fragment not working - Activity result fragment index out of range

My app structure is as follows MainActivity(A ViewPager which contains 2 fragments - Fragment 1 and Fragment 2) | |--Fragment 1 | (ViewPager with several fragments which is an | app tutorial/intro) | |--Fragment 2 …
1
vote
2 answers

Fragment doesnt show up

I am trying to make an activity containing two fragments.The first one has 3 nested fragments which I will use as a tabs and the second one only contains buttons. I don't want to add the buttons fragment into other fragments because I don't want it…
1
vote
2 answers

Android nested fragments -- how to call onActivityResult() for just one child fragment

I have a parent fragment and in that there are three nested child fragments. I want to call the onActivityResult() on my child fragment. I am aware that for nested fragments onActivityResult() is not called, so we need to explicitly call it from the…
uff simon
  • 150
  • 2
  • 6
1
vote
1 answer

FragmentTabHost from Navigation Drawer

I am trying to create an app with the Navigation Drawer using the sample Navigation Drawer app from within Android Studio. My first fragment that I am trying to create from the navigation drawer has 3 tabs and I'm trying to use FragmentTabHost to…
1
vote
0 answers

Menu in nested fragment with viewpager not hiding correctly

I have a view pager that display serval nested fragments. Consider A,B and C are the fragments directly hold by the view pager. And each A,B and C holds a fragment D which the option menu. The problem is that, the menu item is correctly hided when…
1
vote
3 answers

Nested fragment problems on orientation change

I have this situation. A drawer layout -> each section is a fragment A section contain a page viewer (3 fragments ) Each fragment contains a recyclerview and each item is a fragment I have some problems. When the orientation of the screen…
1
vote
1 answer

getChildFragmentManager for non support fragment as nested fragment

I'm using an nested fragment which is of class Fragment, as opposed to SupportFragment (v4). I should use getChildSupportManager to handle this properly, but that suspects v4 support fragments, and I have a regular Fragment (which I can't change, it…
TomCB
  • 3,983
  • 9
  • 40
  • 66
1
vote
2 answers

Android Multiple Dynamically Created Nested Fragments. Confusion and Issue

For my current app, I am using minSdkVersion 14 with fragment support library for creating fragments. Issue(Multiple Dynamically Created Nested Fragment): In other apps that I have created there is only one or two level of dynamic fragments that I…
1
vote
2 answers

Fragment disappear after coming back from startActivityForResult

i have a strange problem. i use nested fragment in my code,( 4 level ) Home -> Services -> ServiceDetails -> Upload in the last fragment ( Upload Fragment ) i want to choose image from the gallery or the camera so i wrote the following code to…
user2910110
1
vote
0 answers

Equivalent of FragmentActvity.onResumeFragments() for (nested) Fragment

I'm trying to avoid this exception throughout my code, even though I've only seen it triggered by some of my code sometimes: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState As suggested by this blog post, I'm…