FragmentManager is an interface for interacting with Fragment objects inside an Activity in Android. While the FragmentManager API was introduced in HONEYCOMB, a version of the API at is also available for use on older platforms through FragmentActivity. For more information about using fragments, read the Fragments developer guide.
Questions tagged [fragmentmanager]
700 questions
2
votes
1 answer
Android DialogFragment - using onCreateView AND adding dialog buttons to the dialog possible?
Because I want to use the FragmentManager in a dialog, I use onCreateView instead of onCreateDialog.
If using this approach, I'm able to set the title of the dialog, but I can't find out how to set dialog buttons. Normally I would do this in…

prom85
- 16,896
- 17
- 122
- 242
2
votes
2 answers
how to go from one fragment to another from a button click in android?
I am working on transaction between fragments in android, I am having a fragment contains some relativelayout, on each layout i have to open a new fragment, So I have refer so many links and tried as below, But it gives me error all time, So Please…

user3820044
- 177
- 1
- 3
- 20
2
votes
0 answers
FragmentTransaction.add() not working properly the first time i load my Activity
I'am working on a Product Detail page that opens every time the user clicks on a product on a list. In the page i have some product image at the top, and then 3 tabs below the image, and a fragment container below the tab to switch between the…

Ibrahim Yildirim
- 2,731
- 2
- 19
- 31
2
votes
2 answers
Android Navigation Drawer with many fragments
I've been struggling with this for a while now, I want to start off with a diagram of my problem:
The three navigation drawer buttons are part of my Base Activity. Each purple block below the three buttons are fragments, and the descendants of each…

DeveryDay
- 161
- 15
2
votes
0 answers
Android - Persist a fragment across many activities
Let's say I have the following:
__________________
|Activity_Parent |
| | |
| | |
| | |
|Fragment_Container|
|Fragment_Footer |
|__________________|\
\
…

Daniel Wilson
- 18,838
- 12
- 85
- 135
2
votes
1 answer
Android:Having problems with fragmentManager(Error XML inflateExeption)
First time I run onClickMap function(click button) it works and the mapFragment appears, then I click spotList button and it works too and the SpotListFragment appears, then I run onClickMap again and the app crashes!
Screen…

Bruno Lorenço
- 35
- 1
- 8
2
votes
0 answers
DialogFragments and findFragmentById
I have this app with a common activity and several different fragments replaced into the same layout ID: R.id.content
Some of the fragments are normal support.v4.Fragment and some are from v4.DialogFragment
On tablets, DialogFragments are shown as…

Budius
- 39,391
- 16
- 102
- 144
2
votes
1 answer
Android add fragments to end of FragmentStatePagerAdapter
I want my adapter to add another page each time it reaches the last page. Here is the code I tried using:
static int ITEMS = 2;
public static class MyAdapter extends FragmentStatePagerAdapter implements OnPageChangeListener{
public…

Sean Murray
- 23
- 3
1
vote
0 answers
FragmentTransaction.add(0, request); crashes for android:compileSdkVersion="26" or above
I started learning android development and am still not that familiar with Java code.
I would like to request permission dynamically using the following code which is from http://www.bytran.org/androidmpermissions.htm
I used android-support-v4.jar…

danka
- 19
- 3
1
vote
0 answers
java.lang.IllegalArgumentException: No view found for id 0x7f0800c4
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textview=findViewById(R.id.textView);
Button button=findViewById(R.id.button);
…

Soumyadeep Paul
- 11
- 1
1
vote
1 answer
How to use fragmentcontainerview in java?
I have a container inside MainActivity like that

devio
- 607
- 9
- 29
1
vote
0 answers
SupportFragmentManager is adding the same fragment multiple times when device is asleep
Like the title says. I have a dialogFragment I want to display in the click of a button. This works just fine. The problem is that when I put the phone to sleep with the fragment still showing, when I wake up the phone and reopen the app, there's…

Atti
- 31
- 2
1
vote
1 answer
Can FragmentResultListener used with the same request key in multiple fragments?
I have FragmentA(nav_graph_a), which navigates to FragmentB(nav_graph_b).
FragmentB navigates to a DialogFragment, which call setFragmentResult(RK_SHARED).
Both FragmentA and FragmentB registers a FragmentResultListener with request key…

Andras Sanislo
- 1,209
- 1
- 9
- 20
1
vote
1 answer
TypeError: Cannot read property 'getFragmentManager' of undefined
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'getFragmentManager' of undefined. This error is popping when I run my nativescript angular application.
It says something wrong in my account.component.ts.
Why this error is occurs…

Naveen Kumar
- 373
- 1
- 9
1
vote
1 answer
Communicate from ChildFragment to Parent when parent button's onClick
I have a parent Fragment that has inside a FragementContainerView in which there is a transition of different Fragments. The parentFragment has a button that when is clicked it has to collect all the data from the different children fragments inside…

mantc_sdr
- 451
- 3
- 17