If you want to do something on the back button, look into the various
button and event listeners and see if it's that button.  Depending on
what you register for and what you return, the ordinary back button
consequences may not longer happen, ie you app can preempt them or
not.

Note that in android you don't actually close activities by choice (I
know, it's odd) they get closed when the system runs out of
resources.

On Sep 17, 8:12 am, Nanard <[email protected]> wrote:
> Hi,
>
> Each time I switch the orientation of the device, onStop() and
> onDestroy() are called.
> They are also called when I close the Avtivity (dismiss()), and when I
> press 'back' key.
>
> In onStop() or onDestroy() methods : how can I know how I can here ?
>
> I'd like to run some code when I close the Activity (back button), but
> not if I change screen orientation
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to