java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.support.v4.app.FragmentHostCallback.getContext()' on a null object reference

Hot problem!
This exception has a lot of traffic. You can help 12 users by writing a short tip.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by maxme
, 1 year ago
Attempt to invoke virtual method 'android.content.Context android.support.v4.app.FragmentHostCallback.getContext()' on a null object reference
via google.com by Unknown author, 1 year ago
via Stack Overflow by mithil1501
, 11 months ago
Attempt to invoke virtual method 'android.content.Context android.support.v4.app.FragmentHostCallback.getContext()' on a null object reference
via GitHub by jt-gilkeson
, 9 months ago
Attempt to invoke virtual method 'android.content.Context android.support.v4.app.FragmentHostCallback.getContext()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.support.v4.app.FragmentHostCallback.getContext()' on a null object reference
at android.support.v4.app.FragmentState.instantiate(Fragment.java:100)
at android.support.v4.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:2047)
at android.support.v4.app.Fragment.restoreChildFragmentState(Fragment.java:1278)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1053)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1268)
at android.support.v4.app.FragmentManagerImpl.dispatchCreate(FragmentManager.java:2138)
at android.support.v4.app.FragmentController.dispatchCreate(FragmentController.java:190)
at com.helpshift.activities.MainActivity.onCreate(MainActivity.java:13)
at com.helpshift.support.activities.ParentActivity.onCreate(ParentActivity.java:21)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5387)
at android.app.ActivityThread.access$1200(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1801)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.