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
2 answers

Android : Referencing child fragment from parent fragment

I have nested fragment scenario. Attempts to reference the child fragment from the parent fragment gives a null. What am I missing here? This is the layout file of the parent fragment.
Abhijith Madhav
  • 2,748
  • 5
  • 33
  • 44
1
vote
3 answers

Trouble in Nesting a fragment within a fragment

I'm beginner to java and android, and i'm currently working on a project in which i have situation of using fragment within a fragment,and i have written a program (mentioned below) from which i am facing an app crash. main fragment: public class…
Harsha
  • 659
  • 10
  • 23
1
vote
1 answer

Android: Fragment stack and destroyed activity causing null pointer exception after onResume

I have an activity with 2 fragments, and one inner-fragment or nested-fragment. The flow of how activity and fragments are created: Activity -> fragment 1 -> fragment 2 + nested-fragment fragment 1 is added to the layout when activity is…
1
vote
1 answer

Replacing nested fragments and clearing EditText

I have the following situation. My activity A contains fragment B. Inside of B, a spinner determines whether fragment C1 or fragment C2 is displayed below the spinner. Each of these contains EditText fields where the user enters data. How to persist…
1
vote
1 answer

Nested fragments survive screen rotation

I've faced with an issue with Nested Fragments in Android. When I rotate the screen the Nested Fragments survive somehow. I've come up with a sample example to illustrate this issue. public class ParentFragment extends BaseFragment { …
ievgen
  • 1,081
  • 11
  • 20
1
vote
4 answers

How to dismiss keyboard when clicking non-EditText views in child fragment

So I find this really cool piece of code for dismissing the keyboard when I click non-EditText views. And it works very well, except for Fragments and DialogFragments started using getChildFragmentManager(). Will someone please shed some light on…
1
vote
1 answer

Dynamic data exchange between child fragments

There is an Activity which has fragments and their child fragments. A dynamically produced string array needs to be exchanged in between two of child fragments. But, whatever I've used techniques for that, it returned null everytime. I also used…
1
vote
0 answers

How do Fragment Backstacks persist and how to restore them?

I have a few related questions, regarding how fragment backstacks persist in android, and, when they're lost, how to go about restoring them. Scenario 1: A fragment F has a complex nested fragment UI, with associated backstack (ie, accessible via…
1
vote
1 answer

Android popBackStack does not load ListView in ListFragment

I ran into this problem where my ListFragment is empty after having popBackStackImmediate I have a main activity which extends FragmentActivity and I have a Navigation drawer attached with my main activity. The first navigation calls a Fragment…
1
vote
2 answers

Strange behavior with getChildFragmentManager in Android 4.3 and less

I've a problem with getChildFragmentManager method. I used it to create several nested fragments in viewpager. This Viewpager is in PopupWindow. In this way, fragments are created and I can see them in UI. Fragments contain a…
1
vote
0 answers

Childfragment not updating ActionBar when resumed after back-press in FragmentStatePagerAdapter

I have a small problem with my application which uses a FragmentStatePagerAdapter when scrolling between pages. First I'll describe how the application is built with a stripped down version. App description I have one Activity which holds everything…
1
vote
1 answer

IllegalStateException Activity has been destroyed - Triple-nested Fragments

I have a Fragment, let's call it... F1 containing a Fragment F2; which in turn contains a Fragment F3. When I launch my application I receive this error: IllegalStateException: Activity has been destroyed which refers to this line of code: …
1
vote
1 answer
1
vote
1 answer

Back on ViewPager my GoogleMap Fragment isn't visible

I'm currently facing a problem with my ViewPager. I've got a ViewPager with in the first tab a Listview, and in the second a FrameLayout to use the Google Maps Fragment (both called from a layout inflate via a different Fragment =>…
1
vote
1 answer

ViewPager in fragment Class is not working properly

Am using ViewPager inside the Fragment class.In that ViewPager have three pages in each pages am show customized list view.ViewPager Some time shows the list view properly in some time it shows blank page. Fragment class with ViewPager public class…