java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' 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 vecalion
, 1 year ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by Lukas
, 1 year ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via GitHub by kacpi2442
, 11 months ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by Unknown author, 2 years ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via GitHub by leibown
, 1 year ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by NikQ
, 5 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 'int java.util.ArrayList.size()' on a null object reference
at md559873f5c332c022bf8710d3c9fbb7bb2.MvxFragmentPagerAdapter2.n_restoreState(Native Method)
at md559873f5c332c022bf8710d3c9fbb7bb2.MvxFragmentPagerAdapter2.restoreState(MvxFragmentPagerAdapter2.java:74)
at android.view.View.dispatchRestoreInstanceState(View.java:13740)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2887)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2893)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java:468)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1094)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

Users with the same issue

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

Write tip

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