merge from froyo-plus-aosp

Change-Id: I9bd45d66c9586b99635d7d05d1f351126bfc9840
This commit is contained in:
The Android Open Source Project
2010-06-25 11:21:37 -07:00
2 changed files with 23 additions and 1 deletions

View File

@@ -22877,6 +22877,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"

View File

@@ -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);