Dear Both,

To make a simple example,
activity A will startActivityForResult for activity B. In activity B,
I call setResult() before I call finish(). However this
onActivityResult(..) in activity A is not called once after I call
finish() on activity B. I notice in some extend, this
onActivityResult(..) will be called if user press <Back> key.

Weird.






On Apr 5, 8:11 pm, Bilal <[email protected]> wrote:
>  do like this
>
>                                 Bundle bundle = new Bundle();
> bundle.putInt("Close", 1);
>  i = new Intent();
> i.putExtras(bundle);
> setResult(RESULT_OK, i);
>  finish();
>
> @Override
>  protected void onActivityResult(int requestCode, int resultCode,
>             Intent i){
>
> try{
>  if(i!=null){
>  Bundle bd = i.getExtras();
>  if(bd.getInt("Close") == 1);
>
>  bd.putInt("Close", 1);
>  i.putExtras(bd);
>  setResult(RESULT_OK, i);
>
>  finish();
>   super.onActivityResult(requestCode, resultCode, i);
>    }
>
>  }catch(Exception e)
>  {
>  Toast.makeText(this, e.toString(), Toast.LENGTH_SHORT).show();
>  }
>
>  }
>
>
>
>
>
> On Mon, Apr 5, 2010 at 3:19 AM, skink <[email protected]> wrote:
>
> > DroidBy wrote:
> > > When onActivityResult(int, int, Intent)  will be called?
>
> > > I notice this is not called when I call finish(); on the activity that
> > > I start with startActivityForResult (Intent intent, int requestCode).
>
> > > Does it means the activity is not exit even I call finish() on it?
>
> > did you call setResult(int) in your child Activity?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
>
> > NEW! Try asking and tagging your question on Stack Overflow at
> >http://stackoverflow.com/questions/tagged/android
>
> > To unsubscribe from this group, send email to
> > [email protected]<android-beginners%2bunsubscr­[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-beginners?hl=en
>
> > To unsubscribe, reply using "remove me" as the subject.
>
> --
> Bilal
>
> ----------------------------------------------------------------------
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> ----------------------------------------------------------------------- Hide 
> quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to