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
-1
votes
2 answers
Using the fragment manager
I'm trying to set up a log in system for an app, and I've been following along with this video series. Basically I understand the general concept of what's going on, but not why he's doing what he's doing sometimes. Anyways, I get some errors with…

PaulBunion
- 346
- 2
- 18
-1
votes
1 answer
Android: error adding frament to the activity
There are some peculiarities on android that i hate like a hell...
The issues around isFinishing() of activity are the worst.
I do understand some actions are not allowed after or during this process, but the only way we have to check it is by this…

Rafael Lima
- 3,079
- 3
- 41
- 105
-1
votes
2 answers
How can i change this code to use it in the activity?
i have this code to set the title while adding the fragment:
if (!HomeActivity.checkLoading)
SettingsMain.showDilog(getActivity());
Call myCall = restService.getHomeDetails(UrlController.AddHeaders(getActivity()));
…

Talal Awija
- 9
- 2
-1
votes
1 answer
Fragment Manager Null Reference Exception
I'm trying to transfer to a new fragment when an item in my recycler view is clicked:
FragmentTransaction fragmentTx = ((AppCompatActivity)Activity).SupportFragmentManager.BeginTransaction();
fragmentTx.Replace(Resource.Id.container,…

euandeas
- 87
- 1
- 9
-1
votes
2 answers
Backstack Issue in fragment and activity
Suppose I have total 7 activity say A, B, C, D, E, F, G, in Activity A I have 4 fragments after clicking on 4th fragment I am launching Activity B, Then Activity C, D, E, F .after Coming to Activity F, I want to navigate to 2 fragments of …

Akshay Padalkar
- 25
- 8
-1
votes
1 answer
Incompatible types: getFragmentManager not working
After importing android.support.v4.app.FragmentManager it still shows an error concerning getFragmentManager. It says Required: android.support.v4.app.Fragmentmanager, but Found: android.app.FragmentManager.
Which is weird because the latter isn't…

ToAsk
- 1
- 5
-1
votes
3 answers
Error in Fragment Transaction
I have just started with android fragment and git stuck while implementing an example from internet.Attaching the following code below.It would be really grate to get some help.
I am getting a error at the line…

vighneshraje
- 49
- 1
- 3
-1
votes
2 answers
How to implement "Add to favorites" button in Android cardView?
I've a list of cardViews which contains two textViews each (title and content) and a toggle button (which is a favourite button). I want to add specific cardviews in which togglebutton is checked to another fragment "favourites" so that user can…

Sopnil Shah
- 51
- 2
- 7
-1
votes
1 answer
Android - Send values from one fragment to another
I'm a beginner on Android and I have already read several topics on this issue, but I can not get this to work on my app.
I've two layouts :
activity_home (android:id="@+id/home_container")
activity_signs (android:id="@+id/signs_container").
I've…

C. Marquay
- 1
- 2
-1
votes
2 answers
getFragmentManager() inside class
i'm trying to getFragmentManager inside class to show my dialogFragment but it's throw error...:
java.lang.ClassCastException: example.MyApplication cannot be cast to android.app.Activity
and here is my full class :
public class…
user7913931
-1
votes
4 answers
Need Help in Fragments(Android)
I have newly started learning android. So i was doing the topic fragment, when i decided to create a fragment on my own,The following is the code that i wrote. However on running the code the emulator shows "fragment2 has stopped ".
Please have a…

hamster
- 29
- 6
-1
votes
3 answers
Why does my fragment shows additional bar below the toolbar?
I have added the corresponding content and activity.xml as well. When I run the app in android studio on my phone, I don't see this additional bar there. But still I am wondering why am I seeing this when I open it in my editor ?

sofs1
- 3,834
- 11
- 51
- 89
-1
votes
1 answer
Changing fragment from broadcastreceiver
So I have a broadcast receiver that works just fine. The problem is that when it is called, I can't change fragments as my class extends BroadcastReceiver and not Activity or Fragment. Therefore I do not have access to getFragmentManager() or…

2JZIgnition
- 3
- 4
-1
votes
1 answer
How to set up tabs with view pager in android?
I have followed the following instructions in order to get sliding tabs with a view pager.
Here is my onCreate method:
mViewPager.setAdapter(new NavigationPagerAdapter(getSupportFragmentManager()));
mTabLayout.setupWithViewPager(mViewPager);
Here…

Tom Finet
- 2,056
- 6
- 30
- 54
-1
votes
1 answer
Nested fragment-No activity to handle intent
I have an activity with fragment A added to it dynamically. Now, I transact from fragment A to fragment B. And then from fragment B to fragment C. Now I have a button here when clicked will place a call. I'm not able to start the call intent and the…

Krishna
- 11
- 6