On Thu, Dec 30, 2010 at 1:50 PM, dashman <[email protected]> wrote:
> i've got a PreferenceActivity subclass.
>
> in the PreferenceActivities, one makes the changes and then
> press he back-key to return to the app.
>
> what's the proper-way  to intercept this back-key within
> the activity or the parent activity so that the changes can be
> reflected.

The best answer is to not do that, but to use
registerOnSharedPrefereneChangeListener() to be notified of any
changes.

Beyond that, you override onBackPressed() like you would in any
Android activity (and also onKeyDown() if you are on Android 1.6 or
earlier).

> also, what's the interface to cancel the changes from these
> PreferenceActivities.

You don't. If you didn't want the change, you should not have
displayed the PreferenceActivity in the first place.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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