Mike,

You've done half the work already, except there is a little confusion
on the purpose of the finishActivity() method. That method only works
the other way around (closing Activity B from Activity A).

What you need to do now is send a "result" back to Activity A telling
it to call finish(). See the "Returning a Result from a Screen"
section here: 
http://developer.android.com/intl/fr/guide/appendix/faq/commontasks.html#opennewscreen

In Activity B, you simple want to do:

if (keyCode == KeyEvent.KEYCODE_BACK) {
    setResult(RESULT_CANCELED);
    finish();
}

and in Activity A, you want to handle the result callback:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_CANCELED) {
        finish();
    }
}



On Wed, Jun 2, 2010 at 12:46 PM, mike <[email protected]> wrote:
> hi NightGospel,,
>
> what exactly did u meant??? could you please give me a sample???
>
> regards,
> Randika
>
> --
> 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

-- 
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

Reply via email to