Saving the state of a SurfaceView when the Activity is stopped and resumed
I have an Activity with a SurfaceView that is managed by a game engine (thread).  I'm overriding the onCreate and the onSaveInstanceState for managing the save/restore state of the thread.

When the preferenes screen is accessed from the menu of that Activity, that Activity goes through its lifecycle to onStop; when the preferences screen is closed, the Activity starts again at onResume, so onCreate does not happen.  The thread however is in a state of TERMINATED and therefore cannot be resumed.

Yes, I can just create a new instance of the thread--but how can I restore the state?  I tried overriding onRestoreInstanceState as well, but after a quick test and reading a little more thoroughly I realized that it's not called in this situation because it's called between onStart and onResume.

What's the best way to handle this?
Saving the state of a SurfaceView when the Activity is stopped and resumed
===

I have an Activity with a SurfaceView that is managed by a game engine (thread).  I'm overriding the onCreate and the onSaveInstanceState for managing the save/restore state of the thread.

When the preferenes screen is accessed from the menu of that Activity, that Activity goes through its lifecycle to onStop; when the preferences screen is closed, the Activity starts again at onResume, so onCreate does not happen.  The thread however is in a state of TERMINATED and therefore cannot be resumed.

Yes, I can just create a new instance of the thread--but how can I restore the state?  I tried overriding onRestoreInstanceState as well, but after a quick test and reading a little more thoroughly I realized that it's not called in this situation because it's called between onStart and onResume.

What's the best way to handle this?