Questions tagged [supportfragmentmanager]

15 questions
1
vote
0 answers

How can we access fragment manager in component activity

i want to show BottomSheetDialog in component activity but in that im not able to find supportFragmentManager. class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { …
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…
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…
1
vote
1 answer

SupportFragmentManager destroyed, behind the scenes

I have this scenario on my MainActivity: // onCreate firebaseAuth.addAuthStateListener { firebaseAuth -> when (firebaseAuth.currentUser) { null -> { hideAppBars() …
0
votes
1 answer

Unable to load google maps in Fragment- Unable to update local snapshot for com.google.android.libraries.consentverifier may result in stale flags -

My map shows as follows: I managed to create a single map before but only in an activity - now I want to create it in a fragment. SelectLocationFragment package com.udacity.project4.locationreminders.savereminder.selectreminderlocation import…
0
votes
0 answers

How to save state of supportFragmentManager kotlin android?

Is there any way to save supportFragmentManager state? I have tried with ViewModel. But it didn't work. After screen rotation when i check 'viewModel.mySupportFragmentManager.isDestroyed', it says true. That means the older supportFragmentManager is…
0
votes
0 answers

How to use 2 Fragment Manager for same Activity

I came up with something new, trying to use 2 Fragment Manager for same activity. So for that I did some customization with help of FragmentHostCallback<{Activity}> and FragmentConroller class. val fmCallBack_1 = DemoHostCallBack(this,…
0
votes
0 answers

Can't get Fragment Manager in my Activity that extends YouTubeBaseActivity

So my app has a Youtube Player view in the main activity, my initial intention was to add a Tablayout with it's ViewPager, however, when coding I realised i couldn't get Support Fragment manager for my Adapter. Header of my class: public class…
0
votes
2 answers

Cannot remove Fragment in Android

I have two fragments, named them "Red" and "Blue" and three buttons. The first one adds "Red" fragment and changes the background to red color, the second one adds "Blue" fragment and changes the background to blue color and the third one has to…
Alex20280
  • 97
  • 6
0
votes
1 answer

SupportFragmentManager doesn't see view id

I try to use SupportFragmentManager for my fragments but I get an error. Is it a glitch or something? It doesn't see placeholder id that is located in mainactivity layout. R.id.placeHolder is red and it says unresolved reference placeHolder. What…
Alex20280
  • 97
  • 6
0
votes
1 answer

How to refresh fragment by clicking on button

I want to refresh my fragment by clicking on its button. How to do it? I try to do it like this but old version of fragment appears on the top of the screen (picture is attached): binding.checkAnswersButton.setOnClickListener { …
0
votes
1 answer

Popbackstack always returns previous call

I've got three Simple Fragments: FragmentA, FragmentB, FragmentC. FragmentA -> FragmentB: FragmentB fragment2 = new FragmentB (); FragmentManager fragmentManager = getActivity().getSupportFragmentManager(); FragmentTransaction fragmentTransaction =…
0
votes
2 answers

Going back to a Fragment from an Activity / RecyclerView.ViewHolder and Passing data

I have an app that I open an activity from a fragment, select an item from the RecyclerView and then populate that original fragment with the data from the item they select. It works the first time, but the data doesn't seem to get carried over back…
-1
votes
1 answer

how to send data between activity and its fragments?

I am working on an app where click on an item in a recycler View opens another activity (Customer-Detail) where there are three Fragments in Tab layout .recycler view contains list of employees, I want to show the details of employee selected from…
-1
votes
1 answer

Android FragmentManager: Custom animation shows wrong exit fragment

I'm using the SupportFragmentManager to navigate between different fragments (let's call them A, B, C, D for simplicity). The navigation itself works correctly. The animation works only correctly considering the entering fragments. My code is…