Hello Mike, I somehow missed your last email.

On Wed, Jun 16, 2010 at 5:16 AM, mike <hasitharand...@gmail.com> wrote:
> Hi Sean,
>
> i hope you also has gone out of answers. any way kindly let me know
> this.
>
> A --> B --> C -->

C --> where? C to A? C to finished?  C to force close dialog?

What I'm looking for is a visual flow of the activities, what isn't
clear is what is supposed to happen once you start hitting the back
button.

>
> if i'm going to start Activity C from Activity B like this
>
> startActivity(Activity C);
>
> and when i press back button from activity C
>
>       �...@override
>        public boolean onKeyDown(int keyCode, KeyEvent event) {
>                // TODO Auto-generated method stub
>                if (keyCode == KeyEvent.KEYCODE_BACK) {
>                    finish();
>                        return true;
>                }
>                return false;
>        }
>
> since i have call finish() method application will redirect back to
> Activity B
>
> so once i'm redirected to Activity B is there a way to capture that
> i'v been back to Activity B
>

Yes, this is the purpose of startActivityForResult() and onActivityResult().

> because onCreate method will not fire up like that how can i capture
> it. then i'll be bale to finish() the activity

You are still trying to fudge your existing code to work. You need to
take this back to the design stage and work out exactly what it is you
want to do.

Saying things like:

> i want Activity C to run on top of Activity B.

Indicates that you require both activities to be open and
communicating with each other simultaneously, this is not a sensible
approach as Activity B could disappear at any time for a variety of
reasons.

Re-think your approach in terms of a website. You don't have
"index.html" and "basket.html" open at the same time, you communicate
between them using a combination of the HTTP request-response pattern
(in Android terms: startActivityforResult-onActivityResult), and
storage solutions such as databases and user sessions (in Android
terms: content providers and extending android.app.Application).

Decouple your dependencies between activities, and this will become a
lot easier.

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