Ok, that must be it.

My counstructor is like this:

    public AccountsPreference(Context context, AttributeSet attrs)
    {
        super(context, attrs);
    }


    public AccountsPreference(Context context, AttributeSet attrs, int
defStyle)
    {
        super(context, attrs, defStyle);
    }


On Apr 26, 11:19 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> OK, I figured it out.
>
> There are three possible constructors on a Preference:
>
> MyPreference(Context ctxt)
> MyPreference(Context ctxt, AttributeSet attrs)
> MyPreference(Context ctxt, AttributeSet attrs, int defStyle)
>
> Somewhere along the line, I picked up the pattern of having the
> one-parameter constructor chain to the two-parameter constructor
> (passing null for the 2nd parameter), and having the two-parameter
> constructor chain to the three-parameter constructor (passing 0 for
> the 3rd parameter).
>
> And that's not the right answer.
>
> I am hoping that the right answer is to only implement the second
> constructor, because the correct default style is internal to Android
> (com.android.internal.R.attr.dialogPreferenceStyle). The second
> constructor is the one used with inflating preference XML.
>
> Thanks to all for the help!
>
> --
> 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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to