Note that there are some explanatory texts on larger screens.

plurals
  1. POClassNotFoundException When Reading Parcel
    primarykey
    data
    text
    <p>I am trying to restore my application from a Parcel (saved in a Bundle).</p> <p>My Activity uses OpenGL so it creates this surface view and calls these functions when it is saving or restoring the app.</p> <pre><code>class MySurfaceView extends GLSurfaceView { /* Lots of other stuff */ public void onRestoreInstanceState(Bundle inState) { Log.d("Wormhole", "Restoring instance state"); mRenderer.onRestoreInstanceState(inState); } public void onSaveInstanceState(Bundle outState) { Log.d("Wormhole", "Saving instance state"); mRenderer.onSaveInstanceState(outState); } } </code></pre> <p>in mRenderer</p> <pre><code>public void onRestoreInstanceState(Bundle inState){ mFlowManager = inState.getParcelable("flowmanager"); } public void onSaveInstanceState (Bundle outState){ outState.putParcelable("flowmanager", mFlowManager); } </code></pre> <p>in mFlowManager</p> <pre><code>public class FlowManager implements Touchable, Parcelable { private enum State { SPLASH, MENU, GAME_SINGLE, GAME_MULTI }; private Connection mConnection; private ScoreDataSource mScoreDataSource; private GameEngine mGameEngine; private SplashScreen mSplash; private MainMenu mMenu; private State mState = State.SPLASH; private long mTime; private int mVersionID; /* Other stuff */ @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel out, int flags) { out.writeString(mState.name()); out.writeParcelable(mSplash, 0); out.writeParcelable(mMenu, 0); } public static final Parcelable.Creator&lt;FlowManager&gt; CREATOR = new Parcelable.Creator&lt;FlowManager&gt;() { public FlowManager createFromParcel(Parcel in) { return new FlowManager(in); } public FlowManager[] newArray(int size) { return new FlowManager[size]; } }; private FlowManager(Parcel in) { mConnection = new Connection(); mState = State.valueOf(in.readString()); mSplash = in.readParcelable(null); // Exception occurs here mMenu = in.readParcelable(null); } } </code></pre> <p>The FlowManager class has instances of other classes that need to be saved. Those classes I made Parselable and it's when restoring them I get the error.</p> <p>I've seen posts about this error but they all were for sending data between apps and having to use a different ClassLoader. This is all the same app. Do I need to set my ClassLoader because this is in a GLSurfaceView? How do I find the ClassLoader I need?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload