diff options
| author | 2010-06-18 12:44:20 -0700 | |
|---|---|---|
| committer | 2010-06-18 12:44:20 -0700 | |
| commit | 766d1b7458e5dae1cca36b01cf13e4d16536a091 (patch) | |
| tree | d7ba82c118862c3de281c4aa4fa421d971d2c04b | |
| parent | e5a023bfbbed6343f895652b51c0d4aa9ac0b8eb (diff) | |
| parent | e429c5ec9d52a5e9af9133f5de9f1002f04aede1 (diff) | |
merge from open-source master
Change-Id: I05e4c26c902f3cfe0dd99107f518768b246562f7
| -rw-r--r-- | api/current.xml | 12 | ||||
| -rw-r--r-- | core/java/android/app/AlertDialog.java | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/api/current.xml b/api/current.xml index e0380e70e095..be3b209b2977 100644 --- a/api/current.xml +++ b/api/current.xml @@ -19334,6 +19334,18 @@ <parameter name="context" type="android.content.Context"> </parameter> </constructor> +<constructor name="AlertDialog.Builder" + type="android.app.AlertDialog.Builder" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="context" type="android.content.Context"> +</parameter> +<parameter name="theme" type="int"> +</parameter> +</constructor> <method name="create" return="android.app.AlertDialog" abstract="false" diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java index 2714de58b6fe..61a8fc3312f9 100644 --- a/core/java/android/app/AlertDialog.java +++ b/core/java/android/app/AlertDialog.java @@ -265,12 +265,22 @@ public class AlertDialog extends Dialog implements DialogInterface { public static class Builder { private final AlertController.AlertParams P; + private int mTheme; /** * Constructor using a context for this builder and the {@link AlertDialog} it creates. */ public Builder(Context context) { + this(context, com.android.internal.R.style.Theme_Dialog_Alert); + } + + /** + * Constructor using a context and theme for this builder and + * the {@link AlertDialog} it creates. + */ + public Builder(Context context, int theme) { P = new AlertController.AlertParams(context); + mTheme = theme; } /** @@ -783,7 +793,7 @@ public class AlertDialog extends Dialog implements DialogInterface { * to do and want this to be created and displayed. */ public AlertDialog create() { - final AlertDialog dialog = new AlertDialog(P.mContext); + final AlertDialog dialog = new AlertDialog(P.mContext, mTheme); P.apply(dialog.mAlert); dialog.setCancelable(P.mCancelable); dialog.setOnCancelListener(P.mOnCancelListener); |