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.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.toptoche.searchablespinnerlibrary.SearchableSpinner) #117

Open
DeviseElectronics opened this issue Jan 23, 2020 · 5 comments

Comments

@DeviseElectronics
Copy link

Caused by java.io.NotSerializableException: android.widget.ArrayAdapter
at java.io.ObjectOutputStream.writeObject0 + 1240(ObjectOutputStream.java:1240)
at java.io.ObjectOutputStream.defaultWriteFields + 1604(ObjectOutputStream.java:1604)
at java.io.ObjectOutputStream.writeSerialData + 1565(ObjectOutputStream.java:1565)
at java.io.ObjectOutputStream.writeOrdinaryObject + 1488(ObjectOutputStream.java:1488)
at java.io.ObjectOutputStream.writeObject0 + 1234(ObjectOutputStream.java:1234)
at java.io.ObjectOutputStream.writeObject + 354(ObjectOutputStream.java:354)
at android.os.Parcel.writeSerializable + 1828(Parcel.java:1828)
at android.os.Parcel.writeValue + 1780(Parcel.java:1780)
at android.os.Parcel.writeArrayMapInternal + 928(Parcel.java:928)
at android.os.BaseBundle.writeToParcelInner + 1589(BaseBundle.java:1589)
at android.os.Bundle.writeToParcel + 1253(Bundle.java:1253)
at android.os.Parcel.writeBundle + 997(Parcel.java:997)
at android.app.FragmentState.writeToParcel + 122(FragmentState.java:122)
at android.os.Parcel.writeTypedObject + 1634(Parcel.java:1634)
at android.os.Parcel.writeTypedArray + 1614(Parcel.java:1614)
at android.app.FragmentManagerState.writeToParcel + 619(FragmentManager.java:619)
at android.os.Parcel.writeParcelable + 1801(Parcel.java:1801)
at android.os.Parcel.writeValue + 1707(Parcel.java:1707)
at android.os.Parcel.writeArrayMapInternal + 928(Parcel.java:928)
at android.os.BaseBundle.writeToParcelInner + 1589(BaseBundle.java:1589)
at android.os.Bundle.writeToParcel + 1253(Bundle.java:1253)
at android.app.IActivityTaskManager$Stub$Proxy.activityStopped + 4545(IActivityTaskManager.java:4545)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run + 145(PendingTransactionActions.java:145)
at android.os.Handler.handleCallback + 883(Handler.java:883)
at android.os.Handler.dispatchMessage + 100(Handler.java:100)
at android.os.Looper.loop + 214(Looper.java:214)
at android.app.ActivityThread.main + 7682(ActivityThread.java:7682)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 516(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main + 950(ZygoteInit.java:950)

@RanbirKaushik
Copy link

Save the state of spinner in OnSavedInstanceState()..

@TechNov
Copy link

TechNov commented Aug 27, 2022

Hello there, any solution ? i'm facing out this bug yet and not found how to solve it....

@GoldenAppStudio
Copy link

use this code..

@OverRide
public void onSaveInstanceState(Bundle savedInstanceState) {
spinnerId.onSaveInstanceState();
}

@Ahmer8
Copy link

Ahmer8 commented Aug 2, 2023

@OverRide
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
// Save the list of strings to the instance state before the activity is destroyed
outState.putSerializable(KEY_STRING_LIST, stringList);
}

@DanielCr95
Copy link

@Ahmer8

I am facing the same error above, i have a List, how can i add it to saveInstanceState?

Can you please include the code for saveInstanceState and onRestoreState?

Thanks a lot

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

6 participants