There are two activites: from the first we open the second with the startActivityForResult method, and on the second for a certain event we set the result RESULT_OK . But after turning the screen on the second RESULT_OK reset. Is there any way to save this state with android tools? The decision to use the boolean isResultOK variable in the second boolean isResultOK and save it through the onSaveInstanceState mechanism, and setResult(RESULT_OK) calls already in onDestroy to work, but it looks like a crutch

  • one
    android: configChanges = "orientation" and if this piece in the manifest of the activit register? - Android Android
  • Yes, it’s a great idea, but in my project I’ve already laid out to re-create the activation while turning, so I’m no longer able to add this attribute ( - Werder

1 answer 1

In your case, onSaveInstanceState will work, save the result. Restore it to onRestoreInstanceState as you wrote.

Remember that onSaveInstanceState will not be called if everything goes smoothly. Doing additional checks with boolean isResultOK may be redundant.