java.lang.NullPointerException

Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web21084

  • Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
  • Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
  • Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
  • Stack trace

    • 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.support.v4.view.ViewPager.onRestoreInstanceState(ViewPager.java:1481) 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.view.View.restoreHierarchyState(View.java:15729) 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.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710) 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 java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    76 times, 1 year ago
    Unknown user
    Once, 11 months ago
    Once, 7 months ago