Questions tagged [child-fragment]

A child-fragment is a Fragment nested inside another Fragment.

If this Fragment is a child of another Fragment, the FragmentManager returned here will be the parent's getChildFragmentManager().

Official Support v4 Fragment Documentation

37 questions
7
votes
3 answers

Shared Element Transition Not Working Between Parent and Child Fragments (Nested Fragments)

In the Main Activity, I have BottomNavigationView where there are 3 different parent fragments. The parent fragment has recyclerview and on item click of recyclerview, I am launching child fragment for more details about the item. I am trying to…
Faisal Shaikh
  • 3,900
  • 5
  • 40
  • 77
5
votes
2 answers

ChildFragmentManager.findFragmentByID() returns null on android 4.4.2

I developed an app, that uses Fragments as part of a Fragment. public class LoginFragment extends Fragment EditTextWithCameraButtonFrag userNameFrag; EditTextWithCameraButtonFrag passwordFrag; public void onActivityCreated(Bundle…
4
votes
4 answers

How to manage Backstack with child fragments?

I am having issues with nested/child fragments. My use case is: I have Frag A as parent fragment and FragChild1, FragChild2, FragChild3 as child fragments to be displayed inside Frag A. Now on back press from FragChild3 it should work like…
3
votes
2 answers

on callingback the viewpager fragment on back press got this error You must call removeView() on the child's parent first

i'm replacing Fragment1(which has a view pager) from its child Fragment1 with Fragment2. Fragment fragment = Childfragment1.this.getParentFragment(); FragmentManager fragmentManager = fragment.getFragmentManager(); FragmentTransaction…
2
votes
0 answers

How to handle events and validation between child and parent fragment in android

I used the navigation component to navigate between fragments. In one of these fragments, I have a fragment that contains a view pager. In this view pager, I have 3 different fragments that handles with 2 buttons for go next page and back to the…
2
votes
1 answer

How to get same childfragments(having recyclerview) instance in all the fragments of viewpager?

I am stuck in a situation where I have recyclerview with item data in it and I need to fetch same instance in all the fragments (three) of viewpager to operate on the same recyclerview. What I have done : I have made one separate fragment names as…
2
votes
2 answers

Android ChildFragmentManager().findFragmentById() always null

I stumbled into a crazy little 'bug', or i'm just doing something wrong. I am trying to get the reference to a fragment that is inside a fragment. So we have ParentFragment, that is a child of MainActivity. I can get a reference to this…
Erik Terwan
  • 2,710
  • 19
  • 28
2
votes
2 answers

Android Google Map API V2 blank screen with nested fragments

I'm working on an android app with an advanced integration of Google Maps API V2. I'm using SupportFragment and everything worked fine until I started to put the map in an further child fragment - there is a deep fragment hierarchy:…
1
vote
1 answer

Error : None of the following functions can be called with the arguments supplied issue in FragmentStateAdapter in viewpager2

See my code I am using viewpager 2 in a fragment to hold child fragments. There can be 'n' number of child fragments. It is showing lint error in adapter. //See my fragment code override fun onViewCreated(view: View, savedInstanceState: Bundle?) { …
1
vote
0 answers

Bottom NavigationView Inside Fragment With ChildFragmentManager Creates Overlap View

I'm trying to show Material Bottom Navigation Inside Fragment. My Bottom Navigation View has three fragments inside it. I solve the problem when the Fragment creates a new instance every time when we select the Navigation item. But the real problem…
1
vote
0 answers

BackPressed via Fragment to previous Fragment-Navigation Component

I want to ask: From childFragment to the previous Fragment, BackPressed() is allowed while using Navigation Component, androidx, Kotlin. What I was trying to code is to navigate fragments and bottomNavigation. In one fragment, I used child fragments…
1
vote
0 answers

Open a dialog fragment from childfragment from Notification

I have a MainActivity which has a viewpager which contains Host fragments(that can contain other fragments with child fragment manager). What I am trying to achieve is to start a dialog fragment from one of the child fragments on clicking action on…
1
vote
2 answers

replace two fragments with each other using animation

I'm just a beginner to native android developing. I have an application in which I have a fragment inside of an activity. This fragment has a header, a footer and in the middle a FrameLayout to display other fragments XML of the…
Yvonne Marggraf
  • 398
  • 2
  • 5
  • 19
1
vote
3 answers

How do I programmatically add this fragment to my fragment?

I am trying to display a nested ListFragment inside my DialogFragment. Apparently I cannot just declare a in the XML for my DialogFragment layout because fragments-in-fragments need the childFragmentManager. So I am trying to do this in…
1
vote
1 answer

issue with google maps and get child fragment manager

I keep getting an error on the line for the support map fragment, i am new to android and java so, do not have the answers it's saying ';' is expected, but once inserted before the get child fragment manager, it makes the support map fragment…
1
2 3