"have Activity 1 use
startActivityForResult() to start up Activity 2, with Activity 2
sending the result back via setResult(), followed by finish(). "

ok, thats exactly what the activities do; but the result back doesnt
work when the hardware keyboarb (back) is used.

What actvity 2 does is:

            public void goBack(){

                rit = new Intent();

                rit.putExtra("updatedYellowR", yellowR);
                rit.putExtra("updatedBlueR", blueR);
                rit.putExtra("updatedRedR", redR);

                setResult(RESULT_OK, rit);

                finish();
            }//goBack

yelllowR, blueR and redR are instances of the same class ...
objects....

On Aug 12, 12:05 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Fri, Aug 12, 2011 at 1:02 PM, hectordu...@yahoo.com
>
> <hectordu...@yahoo.com> 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/commonsguyhttp://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 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

Reply via email to