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

onRestoreInstanceState error #73

Open
Freshm4at opened this issue May 22, 2024 · 0 comments
Open

onRestoreInstanceState error #73

Freshm4at opened this issue May 22, 2024 · 0 comments

Comments

@Freshm4at
Copy link

Freshm4at commented May 22, 2024

@ernestoyaquello
I got an error when onRestoreInstanceState is invoke (user open app when it is in background I guess) and user has Android API >= 33 (Tiramisu)

Fatal Exception: java.lang.NullPointerException
Attempt to read from field 'java.lang.Object[] java.lang.Class.ifTable' on a null object reference in method 'boolean java.lang.Class.isAssignableFrom(java.lang.Class)'

java.lang.Class.isAssignableFrom (Class.java:579)
android.os.Bundle.getParcelable (Bundle.java:947)
com.ernestoyaquello.dragdropswiperecyclerview.DragDropSwipeRecyclerView.onRestoreInstanceState (DragDropSwipeRecyclerView.kt:682)
android.view.View.dispatchRestoreInstanceState (View.java:22756)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)

It comes from this code :
superState = when { SDK_INT >= Build.VERSION_CODES.TIRAMISU -> state.getParcelable(SUPER_STATE_KEY, Parcelable::class.java) else -> @Suppress("DEPRECATION") state.getParcelable(SUPER_STATE_KEY) }

Can you help me ?

PS : Btw, thank you for the library it's a great tool 👍

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