Last active
October 10, 2022 06:48
-
-
Save mcelotti/cc1fc8b8bc1224c2f145 to your computer and use it in GitHub Desktop.
Android FLAG_ACTIVITY_FORWARD_RESULT howto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nav flow is: A => B => C => A with results from C | |
If you're using fragments please note that "onActivityResult" will be called according to where "startActivityForResult" is called (method "startActivityForResult" is available in both, activity and fragment) | |
ActivityA | |
startActivityForResult(intentB, 22); | |
ActivityB | |
intentC.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); | |
startActivity(intentC); | |
finish(); | |
ActivityC | |
setResult(99); | |
finish(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amazing