Linked Questions
27 questions linked to/from What is difference between getSupportFragmentManager() and getChildFragmentManager()?
9
votes
1
answer
17k
views
getSupportFragmentManager VS getChildFragmentManager [duplicate]
I want to create fragment in activity.
I have 4 fragment in 1 activity
I have a code like this
private void setupViewPager(ViewPager viewPager) {
ViewPagerAdapter adapter = new ViewPagerAdapter(...
56
votes
7
answers
95k
views
How to set a ViewPager inside a Fragment
I need to place a ViewPager inside of a fragment, but I have two fragments, Fragment 1 is my MENU, and Fragment 2 I want to use as a ViewPagerIndicator.
But a fragment can't have another fragment... ...
45
votes
3
answers
59k
views
Android: can't replace one fragment with another
I need to replace a Fragment in one Activity with another Fragment, below is the layer file of the Activity:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://...
37
votes
5
answers
40k
views
getParentFragment returning null
I have a Fragment that has a FrameLayout. This first fragment (A) loads inside its Framelayout another fragment (B). When I call getParentFragment from inner fragment (B), I get null. How should this ...
30
votes
2
answers
100k
views
TabHost with Fragments and FragmentActivity
I'm working on an Android App and I want to use 3 tabs for navigation using Fragments for each tab, but I don't know how to create the structure for doing it.
I want to add each fragment separately ...
9
votes
1
answer
4k
views
Lifecycle of a replaced ViewPager and BackStack?
I'm really messed up with the android ViewPager's lifecycle, and I'm starting to think that there something wrong in the structure of my app. So I would like a confirmation if I can do the following :
...
6
votes
1
answer
2k
views
Content of ViewPager disappears when navigating back and forth using Navigation Components
After migrating my navigation to the new Jetpack Navigation Component, I found that after navigating back and forth using the the libraries, the content/layout of the first two fragments in my ...
4
votes
2
answers
2k
views
Fragment with ViewPager having blank pages after returning to it from another fragment
In my application I'm trying to create 2 fragments with ViewPagers. The fragments have 3 tabs/pages each with RecyclerViews and they are supposed to be backed by a database, so I'm keeping them in a ...
1
vote
1
answer
5k
views
Navigation drawer item is Fragment that has tabs
I'm trying to implement a two tabs and also have a navigation drawer. I'm able to do both separately but when I try to combine the two I run into problems. I originally had the code for creating my ...
0
votes
3
answers
5k
views
Crash on Rotation with this error: Fragment has not been attached yet
i have an Activity with 02 tabLayout
i added First Fragment in my first tab, every thing was just fine since i added my Second Fragment in second tab
my Second Fragment works but when i rotate the ...
0
votes
6
answers
3k
views
android.view.InflateException: Binary XML file : Error inflating class fragment
I am using GoogleMap in android app using Android Studio. It was working fine and don't know why suddenly it stopped working. minSdkVersion is 15 and targetSdkVersion is 24. Please check my below code ...
0
votes
1
answer
2k
views
Use interface in bottom sheet
I want to add a interface in my fragment and my bottom sheet and when bottom sheet done an action(like select a button) it call in my background fragment but when i call interface it returns null and ...
4
votes
1
answer
1k
views
IllegalArgumentException: No view found for id , When coming back from another fragment and onResume calls
I have a fragment that most of it's layout is creating programmatically.
First time that fragment appears everything is OK but when I open another fragment and press back button I got ...
4
votes
1
answer
2k
views
Different types of fragmentManagers
There are several different kinds of fragmentManagers in Android: parentFragmentManager, childFragmentManager, supportFragmentManager and plain fragmentManager, which is already deprecated. But what ...