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
6
votes
4 answers

How to inject dependency to nested android fragment?

For an ordinary (non-nested fragment) I use the following approach 1) create dependencies(...) method for setting fragment's dependencies class MyFragment extends MyFragment { void dependencies(Deps deps); } 2) in MyFragment parent's activity…
6
votes
8 answers

fragments in viewpager, no view found error

I have an activity holding a fragment, in this fragment there is a button , when it is clicked, a dialog is popped out. In this dialog, there is a Viewpager, which holds some fragments to display. Here are the code and the error, please spare your…
Huy Than
  • 1,538
  • 2
  • 16
  • 31
6
votes
1 answer

Access to getString() in a fragment that implements a viewpager

I am using a nested fragment using SherlockFragment, all works fine. But i am not being able to make viewpager title to string so that i can support multilanguage using string.xml. Here is my code public class schedule_pl extends SherlockFragment…
6
votes
2 answers

Nested fragment lifecycle

I have 4 fragments. I switch among them by using hide/show transactions. One of them may have nested fragments which are added by replace transaction. The issue is that if I add a nested fragment hide main fragment and show it again the…
6
votes
1 answer

Add fragment into a fragment (nested fragment)

I want to add a youtube fragment into my already existing fragments dynamically. The code I used is below: // setting the Youtube Player Dynamically private int setYoutubePlayer(String desc, View view, int prevID, Bundle input) { …
6
votes
2 answers

getChildFragmentManager raise NoSuchMethod exception on 4.0.3 device but not on 4.2.2

I need to use nested fragments for my application and so I'd like to use getChildFragmentManager. I have two devices: A real one running on 4.0.3 A virtual one running on 4.2.2 It works pretty well on the second one but not on my physical device…
6
votes
2 answers

Android FragmentTab host and Fragments inside Fragments

I have an app with hierarchy like this: FragmentTabHost (Main Activity) - Fragment (tab 1 content - splitter view) - Fragment (lhs, list) - Framment (rhs, content view) - Fragment (tab 2 content) - Fragment (tab 2 content) All…
6
votes
1 answer

ActionBarSherlock + Tabbed Fragments + ViewPager insider a fragment

I have a tabbed application using ActionBarSherlock. Tabs in the ActionBar are each fragments. One of the fragments contains a viewpager which shows a number of fragments - each containing an image from a URL (using a variant of ImageView). Whole…
5
votes
2 answers

Nested fragments getchildfragmentmanager causing crash

I have viewPager which contains fragments each of these fragment has viewpager to display Images and banners now to each fragment Image adapter I am passing getChildFragmentManager() as below CarouselAdapter carouselAdapter = new…
5
votes
2 answers

Android animated nested fragments

I have an activity with a fragment A inside of it. The fragment A have nested fragment B inside of it. I'm switching B with C using following code: getChildFragmentManager() .beginTransaction() …
Ivan Mitsura
  • 433
  • 4
  • 15
5
votes
1 answer

I've got a weird bug when using a ViewPager inside a Fragment

Okay i'll try and make this as clear as possible. I have a Fragment called CheckerManager which contains a ViewPager. This ViewPager will allow the user to swipe between 3 Fragments all of which are an instance of another Fragment called…
5
votes
2 answers

How to get all sub/inner/nested Fragments of a Fragment?

It looks like it's possible to get all fragments of an Activity pretty easily. But how can I get all subfragments for a given fragment ? This question is also related to getParentFragment API 16
Snicolas
  • 37,840
  • 15
  • 114
  • 173
5
votes
4 answers

How to show DialogFragment from Fragment in actionBar android

I use Tabs ActionBar with Fragments. Inside one fragment I have button. I want to show a DialogFragment (inside my fragment) when the button is pressed. How can I do that? This is my code public class MainActivity extends FragmentActivity…
5
votes
1 answer

Child fragment gets destroyed for no good reason

Info: I have a 2 pane layout (2 child Fragments) inside a ParentFragment, which, of course, is inside a FragmentActivity. I have setRetainInstance(true) on the ParentFragment. On orientation change, the left child fragment doesn't get destroyed…
5
votes
1 answer

Android Maps API v2 in Dialog

I am trying to display GMaps in a Dialog, can it be done? I have the layout as