Saturday, April 16, 2011

[android-developers] Re: MessageBox style Preference

Mark's method is also worth considering. 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. For what its worth, I put it under a Utilities category at the
bottom.

On Apr 16, 9:55 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Sat, Apr 16, 2011 at 9:37 AM, Peter Webb <r.peter.w...@gmail.com> wrote:
> > My app has a "Restore Defaults" function in its Preference Activity. I
> > want the user to confirm the selection with a box which says "Are you
> > sure," with a OK button and a Cancel button. I built this using a
> > ListPreference with two items and while it works it doesn't "look
> > right".
>
> > Is there some easy way to modify an existing Preference class to do
> > this?
>
> This feels to me like it should be an options menu choice, not a
> preference. Preferences are settings, not actions. From the options
> menu choice, you can display a regular AlertDialog.
>
> If you disagree, you will need to write your own Preference. Writing a
> DialogPreference is not that hard, though I forget whether you can
> tailor the button captions, which you might need.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://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 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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate