0
在出現某處的AlertDialog中有另一個CheckMark Lollypop!我需要刪除它並留下你自己的。提示,誰可以面對?如何刪除AlertDialog.Multiple中的第一個選中標記選項
AlertDialog:
mSurchargeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean[] checkedItems = new boolean[surchargeListNames.length];
int count = surchargeListNames.length;
for (int i = 0; i < count; i++)
checkedItems[i] = selectedSurchargeItems.contains(surchargeListNames[i]);
AlertDialog.Builder builder = new AlertDialog.Builder(DetailsActivity.this, R.style.AlertDialogCustom);
builder.setMultiChoiceItems(surchargeListNames, checkedItems, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
if (isChecked)
selectedSurchargeItems.add(surchargeListNames[which]);
else
selectedSurchargeItems.remove(surchargeListNames[which]);
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog dialog = builder.create();
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
dialog.show();
}
風格:
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:checkMark">?android:attr/textCheckMark</item>
</style>