Skip to content Skip to sidebar Skip to footer

Android - Getsupportfragmentmanager() Returning Null

I know there are a lot of similar questions here, but none of them have worked for me so far, so I'm hoping by just posting my (slightly redacted) class here, someone can help me o

Solution 1:

I was having the same problem.

What I deduce it about the lifecycle of the activity, in the method onCreate the activity isn't totally created so when you try to pass getSupportFragmentManager its null.

What I do to resolve it, is putting this lines of code in onStart. The problem there is that each time the activity is paused and run it again the Fragment will be restarting.

Post a Comment for "Android - Getsupportfragmentmanager() Returning Null"