2 messages in com.googlegroups.android-beginnersRe: OnActivityResult over several Act...| Subject: | Re: OnActivityResult over several Activities![]() |
|---|---|
| From: | Megha (mjo...@google.com) |
| Date: | 01/30/2008 02:08:53 PM |
| List: | com.googlegroups.android-beginners |
Hi Marcus,
Are you using the resultCode >=0 while starting your second Activity? If not, your startsubActivity() method call will be the same as the startActivity() method call and the result with not be returned to the parent Activity.
Thanks, Megha
On Jan 28, 3:10 pm, Markus <mark...@email.de> wrote:
Hi there, I've got following problem: I've got 3 activities which represents some kind of wizzard. The first activity starts the second via startSubActivity. In the same way the second activity starts the third. On the 3rd activity there is a button called "Finish". If the button is pressed the programm is running following code in the listener:
setResult(RESULT_OK); finish();
In the second activity I'm catching it with the OnActivityResult- Method in that way: protected void onActivityResult(int requestCode, int resultCode, String data, Bundle extras) { switch(resultCode) { case RESULT_OK: setResult(resultCode); finish(); break; case RESULT_CANCELED: setResult(resultCode); finish(); break; } //super.onActivityResult(requestCode, resultCode, data, extras); }
In the first activity I've implemented also an onActivityResult but it seems that the code never reachs there. The first activity is displayed but my breakpoint in the onActivityResult is never hit.
What have I done wrong? Any hints?
Thanks




