Use Activity.setResult() with your own defined result value, then call
Activity.finish().

So, B will call setResult() then finish().  A will now be at the top
of the task, and the finish() called by B will result in a call to A's
onActivityResult() (that is providing that B was started with
startActivityForResult()) which can check for your user defined result
value and then call finish() itself.

On May 3, 8:42 am, CMF <manf...@gmail.com> wrote:
> however it just close activity B:(
>
> On May 3, 12:56 pm, Saurav <to.saurav.mukher...@gmail.com> wrote:
>
>
>
> > well there is a function called <activity obj>.finish()
>
> > this wud suffice ur needs i guess.
>
> > hope this helps.
>
> > Regards,
> > Saurav Mukherjee.
>
> > On Mon, May 3, 2010 at 8:52 AM, CMF <manf...@gmail.com> wrote:
> > > I have two activities,A ,B
> > > A will start activity B
> > > When I press "back"button in B, I want to close A also
> > > But how can I close A here?
>
> > > --
> > > 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<android-developers%2bunsubscr...@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 
> > athttp://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 
> athttp://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