对话框的样式:
AlertDialog.java
单选样式:
setSingleChoiceItems
多选样式:
setSingleChoiceItems
AlertController.AlertParams
private void createListView(final AlertController dialog) {
if (mIsSingleChoice) {
layout = dialog.mSingleChoiceItemLayout;
} else {
layout = dialog.mListItemLayout;
}
if (mCursor != null) {
adapter = new SimpleCursorAdapter(mContext, layout, mCursor,
new String[] { mLabelColumn }, new int[] { R.id.text1 }) {
mSingleChoiceItemLayout;
} else {
layout = dialog.mListItemLayout;
}
if (mCursor != null) {
adapter = new SimpleCursorAdapter(mContext, layout, mCursor,
new String[] { mLabelColumn }, new int[] { R.id.text1 }) {
AlertController
public AlertController(Context context, DialogInterface di, Window window) {
mContext = context;
mDialogInterface = di;
mWindow = window;
mHandler = new ButtonHandler(di);
final TypedArray a = context.obtainStyledAttributes(null,
R.styleable.AlertDialog, R.attr.alertDialogStyle, 0);
mAlertDialogLayout = a.getResourceId(
R.styleable.AlertDialog_layout, R.layout.alert_dialog);
mButtonPanelSideLayout = a.getResourceId(
R