我必須測試這個對話框,但是我沒有得到如何從代碼中點擊第二個或另一個按鈕。在curstom對話框上點擊一下
final CharSequence[] items = {"0", "1", "2","3","4","5","6","7","8","9","10"};
builder = new AlertDialog.Builder(this);
builder.setTitle("Please, express your opinion for this new Regular Path!");
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int item)
{
vote=item;
dialog.cancel();
}});
AlertDialog alert = builder.create();
alert.show();
是否有任何答案適合您? – WonderCsabo