On Fri, Aug 12, 2011 at 1:02 PM, [email protected] <[email protected]> wrote: > Hi guys, > My app has two activities with a parcelable object going forward and > back between them, which works fine. The problem comes when user goes > back (from activity 2 to main activity) by using the hardware > keyboard. In that moment the method onStop suppose to be called and > the activity must launch an intent in order to save results into the > main activity, which doens not work :-( > > I wonder what i am doing wrong? ...
Activity 2 should not "launch an intent in order to save results into the main activity". If Activity 2 feels a bit like a dialog box (e.g., "Please pick something out of this list"), have Activity 1 use startActivityForResult() to start up Activity 2, with Activity 2 sending the result back via setResult(), followed by finish(). If Activity 2 is just some other activity (e.g., "Please edit the thing you picked in Activity 1"), then Activity 1 and Activity 2 should be sharing a real data model (database, content provider, etc.). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

