OK Mike, so reading carefully through your explanation, it looks to me
that the process you want is this:

A -> B -> C -> A -> (app close)

Whilst what you are actually getting, with your current code, is this:

A -> B -> C -> A -> A -> B -> (unknown)

The complex nature of your activity jumping suggests that the code is
simply too complex. I suggest you replace all the onKeyDown() and
startActivityForResult() handling for something like this:

----------------
Activity A
----------------

// This code goes in the correct method of Activity A to start Activity B
startActivity(new Intent(ActivityA, ActivityB));

----------------
Activity B
----------------

// This code goes in the correct method of Activity B to start Activity C
startActivity(new Intent(ActivityB, ActivityC));

// Set the "noHistory" attribute for Activity B in your AndroidManifest.xml
<activity android:name="ActivityB" android:noHistory="true">...</activity>

----------------
Activity C
----------------

// This code goes in the correct method of Activity C to jump back to Activity A
finish();


The outcome should be the navigation you are looking for. Activity B
is skipped when you press the back button from Activity C. Pressing
the back button again will close the application.


Cheers,

Sean


On Fri, Jun 4, 2010 at 1:03 PM, mike <hasitharand...@gmail.com> wrote:
> hi Sean,
>
> this is what i have done.
>
> i Have 3 activities. Activity A, Activity B, and Activity C.
>
> Activity A is the starting Activity.
>
> according to a user action Activity A will navigate to Activity B like
> this.
> finish();
> startActivityForResult(Activity B, 102);
>
> Activity A --> Activity B
>
> after 5 seconds Activity B will starts Activity C
>
> StartActivity(Activity C)
>
> and will not finish Activity B.
>
> on top of Activity B, Activity C will be run.
>
> this is Activity C onCreate method
>
>       �...@override
>        protected void onCreate(Bundle savedInstanceState) {
>                // TODO Auto-generated method stub
>                super.onCreate(savedInstanceState);
>                Bundle b = getIntent().getExtras();
>                msg_id = b.getLong("ID");
>
> getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
>
> WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
>                setContentView(R.layout.blur_blue);
>        }
>
> this is manifest.xml
>
>        <activity android:name=".Activity C" android:theme="@style/
> Theme.Blue"/>
>
> this is my theme.xml
>
> <?xml version="1.0" encoding="utf-8"?>
> <resources>
> <drawable name="Blue">#770000ff</drawable>
> <drawable name="Green">#7700ff00</drawable>
> <drawable name="Purple">#70970468</drawable>
> <drawable name="Pink">#70de6496</drawable>
> <drawable name="Red">#7f00</drawable>
> <drawable name="Orange">#70ff7e00</drawable>
> <drawable name="Yellow">#70fff000</drawable>
> </resources>
>
> so Activity C will run on top of Activity B.
>
> so when i pressed back button from activity C
>
> application should redirects to Activity A.
>
>       �...@override
>        public boolean onKeyDown(int keyCode, KeyEvent event) {
>                // TODO Auto-generated method stub
>                if (keyCode == KeyEvent.KEYCODE_BACK) {
>                    finish();
>                    finishActivity(102);
>                    startActivity(new Intent(Acitivyt C, Activity
> A ));
>                        return true;
>                }
>                return false;
>        }
>
> Application redirects to Activity A and when i pressed back from
> Activity A
>
> again it redirects to Activity B and will not close the application.
>
> this is what i'm doing in Activity A
>
>       �...@override
>        public boolean onKeyDown(int keyCode, KeyEvent event) {
>                // TODO Auto-generated method stub
>                boolean b = false;
>                if (keyCode == KeyEvent.KEYCODE_BACK) {
>                        // int x = android.os.Process.SIGNAL_QUIT;
>                        finish();
>                        finishActivity(102);
>                }
>                return b;
>        }
>
> so Sean what do you think?? what can be done.
>
> regards,
> Mike
>
> --
> 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

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