final AlertController.AlertParams p = mAlertParams;
p.mCursor = mCursor;
p.mOnClickListener = mRingtoneClickListener;
p.mLabelColumn = MediaStore.Audio.Media.TITLE;
p.mIsSingleChoice = true;
p.mOnItemSelectedListener = this;
p.mPositiveButtonText = getString(com.android.internal.R.string.ok);
p.mPositiveButtonListener = this;
p.mNegativeButtonText = getString(com.android.internal.R.string.cancel);
p.mPositiveButtonListener = this;
p.mOnPrepareListViewListener = this;
p.mTitle = intent.getCharSequenceExtra(RingtoneManager.EXTRA_RINGTONE_TITLE);
if (p.mTitle == null) {
p.mTitle = getString(com.android.internal.R.string.ringtone_picker_title);
}
setupAlert();
if (mClickedPos == POS_UNKNOWN) {
mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
if (null != mOkButton) {
mOkButton.setEnabled(false);
}
}
Window w = getWindow();
WindowManager.LayoutParams attrs = w.getAttributes();
attrs.width = WindowManager.LayoutParams.MATCH_PARENT;
w.setAttributes(attrs);