1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
19import com.android.internal.app.AlertController;
20
21import android.content.Context;
22import android.content.DialogInterface;
23import android.database.Cursor;
24import android.graphics.drawable.Drawable;
25import android.os.Bundle;
26import android.os.Message;
27import android.util.TypedValue;
28import android.view.ContextThemeWrapper;
29import android.view.KeyEvent;
30import android.view.View;
31import android.view.WindowManager;
32import android.widget.AdapterView;
33import android.widget.Button;
34import android.widget.ListAdapter;
35import android.widget.ListView;
36
37/**
38 * A subclass of Dialog that can display one, two or three buttons. If you only want to
39 * display a String in this dialog box, use the setMessage() method.  If you
40 * want to display a more complex view, look up the FrameLayout called "custom"
41 * and add your view to it:
42 *
43 * <pre>
44 * FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom);
45 * fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
46 * </pre>
47 *
48 * <p>The AlertDialog class takes care of automatically setting
49 * {@link WindowManager.LayoutParams#FLAG_ALT_FOCUSABLE_IM
50 * WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM} for you based on whether
51 * any views in the dialog return true from {@link View#onCheckIsTextEditor()
52 * View.onCheckIsTextEditor()}.  Generally you want this set for a Dialog
53 * without text editors, so that it will be placed on top of the current
54 * input method UI.  You can modify this behavior by forcing the flag to your
55 * desired mode after calling {@link #onCreate}.
56 *
57 * <div class="special reference">
58 * <h3>Developer Guides</h3>
59 * <p>For more information about creating dialogs, read the
60 * <a href="{@docRoot}guide/topics/ui/dialogs.html">Dialogs</a> developer guide.</p>
61 * </div>
62 */
63public class AlertDialog extends Dialog implements DialogInterface {
64    private AlertController mAlert;
65
66    /**
67     * Special theme constant for {@link #AlertDialog(Context, int)}: use
68     * the traditional (pre-Holo) alert dialog theme.
69     */
70    public static final int THEME_TRADITIONAL = 1;
71
72    /**
73     * Special theme constant for {@link #AlertDialog(Context, int)}: use
74     * the holographic alert theme with a dark background.
75     */
76    public static final int THEME_HOLO_DARK = 2;
77
78    /**
79     * Special theme constant for {@link #AlertDialog(Context, int)}: use
80     * the holographic alert theme with a light background.
81     */
82    public</