I just played with tailoring the preference stuff to add a both a
"Reset All" preference, as well as adding a little "Reset" button next
to the checkbox/whatever for the other preference types, so that you
can easily just reset a specific preference, with the "Reset" being
visible only if you're not using the default value.  You just need to
get a handle on the layout the preference itself is using for the
widget area (I think it's android.R.id.widget_frame - at least in 2.2)
and you can go to town... there may be reasons not to do it this way,
but so far it certainly seems like a comfortable thing from a
user-experience perspective.

On Sat, Apr 16, 2011 at 10:08 AM, Mark Murphy <[email protected]> wrote:
> On Sat, Apr 16, 2011 at 10:02 AM, James W <[email protected]> wrote:
>> I didn't do it that way
>> because in my experience Menu options are not typically used in a
>> Preference activity, so I wanted my users to be able to easily find
>> it.
>
> Yeah, I hear you.
>
> Yet another possibility is to use your own layout for the
> PreferenceActivity. On 1.x and 2.x, PreferenceActivity is just a
> ListActivity with a chocolate coating, so you can use your own layout
> if you want, following the ListActivity rules. Hence, if you want a
> Reset option without hiding it in the options menu, yet not as a
> Preference, use a custom layout and a Button. On 3.x, you may be able
> to use an actual options menu -- presumably, it'll show up in the
> action bar like any other options menu, meaning you could add it as a
> toolbar button if you wanted.
>
> BTW, nice to see that doing this via a regular Preference is not that
> hard -- I've only ever fussed with DialogPreference.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> 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

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