Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.os.BaseBundle.getInt(java.lang.String)' on a null object reference #289

Open
arundwi09 opened this issue Mar 14, 2019 · 1 comment

Comments

@arundwi09
Copy link

arundwi09 commented Mar 14, 2019

  Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.os.BaseBundle.getInt(java.lang.String)' on a null object reference
   at com.github.ksoichiro.android.observablescrollview.a.restoreState(SourceFile:71)
   at android.support.v4.view.ViewPager.setAdapter(SourceFile:528)
   ---------
   at android.os.AsyncTask.finish(AsyncTask.java:660)
   at android.os.AsyncTask.-wrap1(AsyncTask.java)
   at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:677)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6162)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
@arundwi09
Copy link
Author

can't we add null check in restoreState method, like

if (state != null) {
    //TODO
} else {
    super.restoreState(state, loader);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant