java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.util.SparseArray.get(int)' on a null object reference

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 githubdoramon
, 1 year ago
Attempt to invoke virtual method 'java.lang.Object android.util.SparseArray.get(int)' on a null object reference
via Stack Overflow by Hoang Duc Tuan
, 9 months ago
Attempt to invoke virtual method 'java.lang.Object android.util.SparseArray.get(int)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.util.SparseArray.get(int)' on a null object reference
at android.view.View.dispatchRestoreInstanceState(View.java:14970)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3188)
at android.support.design.internal.NavigationMenuPresenter$NavigationMenuAdapter.restoreInstanceState(SourceFile:585)
at android.support.design.internal.NavigationMenuPresenter.onRestoreInstanceState(SourceFile:180)
at android.support.v7.view.menu.MenuBuilder.dispatchRestoreInstanceState(SourceFile:348)
at android.support.v7.view.menu.MenuBuilder.restorePresenterStates(SourceFile:360)
at android.support.design.widget.NavigationView.onRestoreInstanceState(SourceFile:197)
at android.view.View.dispatchRestoreInstanceState(View.java:14975)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3188)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3194)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3194)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3194)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3194)
at android.app.Activity.onRestoreInstanceState(Activity.java:1140)
at android.app.Activity.performRestoreInstanceState(Activity.java:1085)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1176)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3098)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3224)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1682)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6843)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

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