I have three activities A, B and C. Suppose A starts B and B starts C with startsActivity()
.
Stack becomes A, B, C.
Now suppose, C makes B to come to front by using startActivityForResult()
and passing FLAG_ACTIVITY_REORDER_TO_FRONT
.
Stack becomes A, C, B.
In B, I have written this code:
override fun onBackPressed() {
setResult(RESULT_DESTROY_C)
super.onBackPressed()
}
I am expecting that C's onActivityResult()
would be called after back button on B is pressed. But it is not getting called. Why? Please help.
Please note that this is not duplicate of this question. Scenario of my question is different.