Saturday, August 28, 2010

[android-developers] Re: Why is DialogPreference abstract?

First of all, DialogPreference is not meant to show a normal dialog
anyway. This is used in Preferences.

I would suggest that you extend the Dialog class. That should help you
in all ways to show your license. You can customize the layout,
buttons, title etc.

http://developer.android.com/reference/android/app/Dialog.html

-Kumar Bibek
http://techdroid.blogspot.com

On Aug 26, 7:45 am, Zsolt Vasvari <zvasv...@gmail.com> wrote:
> If I want to use a DialogPreference to show a pop-up dialog, for
> example, for a license agreement, I have to derive from
> DialogPreference:
>
> public class LicensePreference extends DialogPreference {
>
>     public LicensePreference(Context context, AttributeSet attrs)
> {
>         super(context, attrs);
>     }
>
>     public LicensePreference(Context context, AttributeSet attrs, int
> defStyle)     {
>         super(context, attrs, defStyle);
>     }
>
> }
>
> This seems unneccessary and silly, what was the reasoning behind
> making DialogPrefernce abstract?

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