How can I force a call to onSaveInstanceState

Viewed 2089

I've implemented onSaveInstanceState and onRestoreInstanceState in my android activity.

These seem to work OK, but I'd like to explicitly save the instance state when certain things happen (e.g. when the user presses a button) in case the application crashes, or I terminate it via the debugger

I can call the method obviously, but that doesn't provide the correct Bundle or anything else.

I've looked around, but I can't see any way to do this. Is it possible?

If not, can anyone offer a decent solution for saving activity state at specific points in case of crash/termination?

Thanks

1 Answers
Related