I have two activities A and B. A launches activity B. In activity B I call setResult(RESULT_OK, intent) in a button click handler without calling finish() - which is the desirable behavior.
After rotating B and pressing back, A's onActivityResult receives RESULT_CANCELED for resultCode, rather than RESULT_OK.
I know this is caused by the fact that activity B was destroyed upon rotation. What's the common practice to make sure the correct result code is returned from B?
My initial thought is to save up mResultCode in onSaveInstanceState.