I'm not very sure how to preserve all the variables initialiazed on an OpenGL ES app for Android. My app is quite slow to initialize, and if I don't preserve the initialiazed variables, every time I turn off and on again the screen, or press the home key and return to the app, all of the initial operations start again, and this causes a slow return to the game, and it goes back to the first state of the game.
How can I preserve the app status to go back to it without having to initialize everything again if the app is put in background? Do I have to modify the onSaveInstanceState
function?
Edit: What I want is that the app doesn't reload the context, and that returning to it doesn't last like if it were first initiated