Friday, August 12, 2011

Re: [android-developers] Re: Activity Lifecycle question

On Fri, Aug 12, 2011 at 3:17 PM, Kostya Vasilyev <kmansoft@gmail.com> wrote:
> Try calling setResult from onPause - I believe onStop is too late, due
> to how Start/Stop/Pause/Resume are intermingled.

Last I checked, even onPause() is too late.

Hector:

The idea is that you call setResult() when the user makes a choice
(e.g., from onListItemClick() of a ListActivity). The BACK button is
effectively like hitting <Esc> on a desktop dialog box, indicating
that you didn't really want to make that choice in the first place. As
TreKing notes in his reply he sent while I was typing this,
onActivityResult() is called with RESULT_CANCELED, so you can detect
this case.

Any activity started via startActivityForResult() must be designed to
allow users to say "sorry, never mind". In fact, pretty much
everything in Android needs to support "sorry, never mind".

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment