Can any one tell me the the working of Intent.FLAG_ACTIVITY_FORWARD_RESULT Live Example
now what I am doing just creating three activity that are A,B,C
so When I am Launching Application from activity A and from A I am Starting Activity B with startActivityForResult(Activity B) and there In B Activity I am starting activity C with Intent.FLAG_ACTIVITY_FORWARD_RESULT and finishing B Activity,so now from there in Activity C When I finished to Activity C it gives result back to the Activity A in onActivityResult().
So i want to know that is this the purpose of using this flag or that is something different and if I am wrong please let me know.
and please try to give answer with example.
Use Intent Flags Intents are used to launch activities on Android. You can set flags that control the task that will contain the activity. Flags exist to create a new activity, use an existing activity, or bring an existing instance of an activity to the front.
The flags you can use to modify the default behavior are: FLAG_ACTIVITY_NEW_TASK. Start the activity in a new task. If a task is already running for the activity you are now starting, that task is brought to the foreground with its last state restored and the activity receives the new intent in onNewIntent() .
putExtra method is used.
Virendra, your assumptions are correct. This gist demonstrates a simple use case: https://gist.github.com/mcelotti/cc1fc8b8bc1224c2f145. Please note the use of setResult()
in ActivityC before it is finished.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With