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

FragmentTabHost "Activity has been destroyed"

I have 3 fragment tabs, fragment1, fragment2, and fragment3. I have created another fragment tabs in fragment2. The problem is whenever I reselect fragment2 that contains fragment tabs, my app crashes with the LOGCAT shown below. I have follow a…
KC Chai
  • 1,607
  • 9
  • 30
  • 59
2
votes
3 answers

FragmentTabHost, Nested Fragments and ViewPager

I have an activity which makes use of a FragmentTabHost, so each tab has a fragment inside it. In the first tab, I have 2 nested fragments, one on the top half of the screen, the other on the bottom half. The fragment on the bottom uses a ViewPager…
2
votes
2 answers

android.support.v4.app.Fragment: undefined method getChildFragmentManager()

I'm using ActionBarSherlock and ViewPageIndicator and I tried to implement nested fragments, but the method getChildFragmentManager() is undefined in myandroid.support.v4.app.Fragments. There are no other errors and ABS and VPI work as…
2
votes
2 answers

ViewPager inside Tab doesn't display items properly

I have a FragmentActivity that sets up a tabhost. Each tab is a simple Fragment called TabFragment. TabFragment has a ViewPager, in this case it is an InfiniteViewPager by antonyt (discussed here: ViewPager as a circular queue / wrapping). The…
1
vote
1 answer

Unable to NotifyDataSetChanged on a RecyclerView when EditText is in Focus

I have an Activity with a fragment called MainFragment which has a ViewPager2 to display a few Fragments. One of which is SearchFragment. SearchFragment has an EditText with a TextWatcher, upon text change, an API call is being made to fetch the…
1
vote
1 answer

Navigating back from nested fragments in ViewPager

I need to display multiple set of instructions to the user. For each instruction(FragmentA) the user can navigate to another screen (FragmentA1). I have used a ViewPager that hold list of fragments. When user navigates to the first…
1
vote
1 answer

List View inside ViewPager using nested fragments - huge performance drop

as in topic i have huge problem with optymalization of my activity. wireframe At root level we have three controls: - Tab Layout, related with ViewPager - SurfaceView displaying plot for every fragment - and ViewPager itself ViewPager displays…
1
vote
0 answers

IllegalStateException Fragment already added - Android

I am adding fragment like bellow : @OnClick(R.id.lnNews) void newsList() { String tagName = returnStatusFragment(getString(R.string.news_list_fragment)); if (!TextUtils.isEmpty(tagName) &&…
1
vote
1 answer

How to make onActivityResult get called on nested fragment from viewpager

This is a famous problem of getting result from activity to a nested fragment, the activity could send the result to only the Fragment that has been attached directly to Activity but not the nested one. That's the reason why onActivityResult of…
1
vote
3 answers

Nested fragments - Screen of Frag2 stays empty

I'm suffering through nested fragments. I have a mainactivity which calls a fragment 1 which in turns call a fragment via a button. The fragment frag2 is well instantiated but the screen is blank. Is there something obvious with my…
narb
  • 958
  • 1
  • 13
  • 39
1
vote
2 answers

How to use nested fragments with getChildFragmentManager()?

Edit: Hey guys I have deleted everything because I finally found the answer to my question (basically how to use a scrollview inside ViewPager inside a fragment). Here is my code for everything. I am a total noob so I don't really understand what is…
1
vote
2 answers

Nested fragment and back stack

I have a fragment in which there is a nested fragment which I add in this way: if (home == null) { home = new MyFragment(); FragmentTransaction transaction = getFragmentManager().beginTransaction(); …
charbinary
  • 1,875
  • 4
  • 17
  • 25
1
vote
1 answer

Nested fragment filling the rest of the space

I would like to have a nested fragment which should take the rest of the space. The problem is that it even doesn't show because the height is 1 px. If I set the height to 300 dp for example everything looks ok. Here is my code. Maybe the layout…
charbinary
  • 1,875
  • 4
  • 17
  • 25
1
vote
2 answers

Back in fragment and nested fragment

i have app like this one activity and inside it > fragment a (loaded when run app also from menu can open it ) fragment b (open it from just menu) fragment c (can open it from fragment a and also can open it from menu) also inside fragment c…
user5386763
1
vote
1 answer

Setting InteractionListener with inner fragment

As far as I know it is recommended to attach InteractionListener interface to a fragment inside the onAttach method like this @Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof…
T.Vert
  • 279
  • 2
  • 13