我有這個對話框中有4個項目。而且我需要讓第一個項目不可選(不可點擊),我該怎麼做?如何使對話框中的某些項目不可選?
String[] presets = { getString(R.string.string1), getString(R.string.string2), getString(R.string.string3), getString(R.string.string4) };
AlertDialog dialog;
AlertDialog.Builder builder = new AlertDialog.Builder(ListFragment.this.getActivity());
builder.setTitle(name);
builder.setItems(presets, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int position1) {
switch(position1) {
case 0:
//some code
break;
case 1:
//some code
break;
case 2:
//some code
break;
case 3:
//some code
break;
}
dialog.dismiss();
}
});
dialog = builder.create();
dialog.show();
你的意思點擊窗口小部件? – 2013-04-07 15:48:15
是.................. – Adam 2013-04-07 15:53:38
沒人????????? – Adam 2013-04-07 16:00:15