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

SingleLiveEvent with conditional trigger

I am using nested fragments so fragment1 opens fragment2 and they share a viewmodel. This viewmodel calls a repository to get data and using a LiveData it posts the result and then fragment2 displays the data. My problem was the second time…
0
votes
1 answer

No view found for id 0x7f0a01a2...for fragment

I have an Activity A which implements NavigationView.OnNavigationItemSelectedListener that connects it to fragments 1, 2, 3. Fragment 1 has a viewPager and a pagerAdapter which connects it to fragment 4, 5, 6. I run this and I get an error when…
0
votes
0 answers

NestedFragment in DialogFragment

I have a DialogFragment which contains a FragmentContainerView with the following layout:
Daniel
  • 1
  • 2
0
votes
1 answer

OnMapReadyCallback not transmitted to parent fragment in nested multipane layout using Navhost

I have Navhost which contains photo fragment and map fragment. Map fragment is working when I use it alone, but when I try to integrate it in parent fragment I can scroll map but I cannot use any marks and other my custom options. I do not want to…
0
votes
0 answers

Nested Fragments doesn't back to the previous one

In main Activity I show new DialogFragment which is ParentFragment with only 1 frameLayout in it. From this fragment i add new Fragment into frame layout. (Fragment A) val fragment = GetCheckQrChildFragment.newInstance() …
0
votes
2 answers

Nested fragment deep link back stack handling

I have below screen hierarchy [Activity1] -> [fragment1] -> [fragment2] -> [fragment3] I have a deep-link which should open [Activity1] with [fragment3]. On back press, It should navigate to [fragment2] and further back press to [fragment1] How can…
0
votes
1 answer

multiple fragments - where to commit them?

I'm trying to wrap my head around how and where i should be setting up my fragments. Use case senario i'm trying to implement I have a mainActivity that has a bottomNigationView widget that will open different fragments (fragment A, B and C) In…
Barcode
  • 930
  • 1
  • 13
  • 31
0
votes
1 answer

getParentFragment() in fragments is returning null when fragment is popped out from backstack

I have an activity containg framelayout, fragment A is hosted with getSupportFragmentManager() in this. This fragment A hosts two more fragments which has recycler views in it -Fragment A1 and Fragment A2 using FragmentStatePagerAdapter. At this…
0
votes
2 answers

Android Nested Fragment and Interface

I have a Fragment A which has an interface that will return the value of a TextView. The Fragment A is initialized and Attached to FragmentB. Here is the code for Fragment A and B. Fragment A public class FragmentA extends Fragment { ... …
0
votes
1 answer

Class Cast Exception retrieving Chosen date from childfragment to show in parent fragment

I have a parentfragment called Planning in which I want to show a DialogFragment called DatePickerfragment.The DatePickerFragment has a button that when clicked, will show a datepicker for the user. The user selects a date and that date should be…
jonamar
  • 17
  • 1
  • 8
0
votes
0 answers

Tabs (with fragments) within Fragment

I created the tabs by following this https://www.youtube.com/watch?v=zcnT-3F-9JA but in this tutorial the tabs are within an activity where as I need them within fragments something like nested fragments. And for the fragment I have added the code…
0
votes
0 answers

Child fragment disappears when keyboard pops up

UPDATE 1: Adding android:windowSoftInputMode="adjustPan" in manifest file solved the problem for portrait mode. But in landscape mode the problem still exists. ORIGINAL QUESTION: Current structure is like this: Activity -> Fragment -> Child…
WOLF.L
  • 374
  • 5
  • 15
0
votes
1 answer

Google Places Auto Complete fragment causes duplicate id error

Hi I am using google's places autocomplete api in my app. I need the google places fragment in another fragment and have got it working. Basically I have a tab with 3 imagviews and when you click on one a fragment would fill the main frame layout.…
0
votes
0 answers

implementing nested fragments

I have a GenericContainer That extends an activity. GenericContainer takes case of my fragments, i am using viewStubs to populate them. How to implement nested fragments in GenericContainer. I will be opening stubOne first and then from stubOne I…
0
votes
1 answer

Nested fragment issue - frag1 calls frag2 which has an impact on the listview from frag1

I thought that calls to a fragment were synchronous but it's not. I have a fragment 1 that contains a listview that I update through an adapter. Then I have a button that launches fragment 2. Frag2 has an effect on the listview of frag1 so I thought…
narb
  • 958
  • 1
  • 13
  • 39