On Mon, Oct 3, 2011 at 9:27 AM, Chenna Venkatasubbaiah <chenn...@gmail.com> wrote: > I have started a launched MainActivity and started a SubActivity for Result. > In subactivity i am scanning barcode of items from barcode app and adding > items in collection. I have to return the scanned items after clicking done > button in subactivity.
OK. > I am creating a Message object and returning message.sendToTarget() > > is it the right way I am doing? Not for startActivityForResult(). Quoting the Activity documentation: "When an activity [started by startActivityForResult()] exits, it can call setResult(int) to return data back to its parent. It must always supply a result code, which can be the standard results RESULT_CANCELED, RESULT_OK, or any custom values starting at RESULT_FIRST_USER. In addition, it can optionally return back an Intent containing any additional data it wants. All of this information appears back on the parent's Activity.onActivityResult(), along with the integer identifier it originally supplied." -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.1 Programming Books: http://commonsware.com/books -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en