Friday, September 23, 2011

Re: [android-developers] parcelable again: passing object BACK through activity stack

1) The onActivityResult will have a result-code of RESULT_CANCELED and its 'Intent data' parameter will be null.

2) Yes, you can pass back any Intent, even the one that started the child-activity. You don't need to create a brand new one.

When an Intent is passed back or forth between Activities (starting an activity / setResult+finishing), the other end (getIntent() / Intent in the onActivityResult) doesn't get the exact same instance of the Intent. Instead, it'll get a copy of it as an Intent with the exact same contents. As a comparison: Intents are passed by copy, not by value or reference :-)


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment