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 Stack Overflow by JackW5808
, 9 months ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by JackW5808
, 9 months ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by Constantin Cerberus
, 2 years ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by F. Untermoser
, 1 year ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via Stack Overflow by Alexandre MICHAUD
, 8 months ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
via GitHub by kacpi2442
, 9 months ago
Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at android.support.v4.app.FragmentManagerImpl.getFragment(FragmentManager.java:873)
at android.support.v4.app.FragmentStatePagerAdapter.restoreState(FragmentStatePagerAdapter.java:215)
at android.view.View.dispatchRestoreInstanceState(View.java:15751)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3231)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java:475)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1329)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executePopOps(BackStackRecord.java:803)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2353)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2146)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2008)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
76 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 11 months ago

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