私は本当に単一のボタンでAlertDialogを作りたいと思っています。ありがとう!AlertDialogには単一のボタンがありますか?
1
A
答えて
2
はい次のことができます。
new AlertDialog.Builder(this)
.setIcon(R.drawable.icon)
.setTitle("Error")
.setMessage("Please fill out the entire form")
.setPositiveButton("Close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.create()
.show()
;
2
0
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public onClick(DialogInterface dialog, int which) {
// do something interesting.
}
});
// other code to customize the dialog
Dialog d = builder.create();
手がかりはありますか?言語、プラットフォーム、Web /デスクトップ –
アンドロイドで警告ダイアログを作成したい –
あなたはどの言語やプラットフォームで作業していますか? 'AlertDialog'はおそらくAndroidからのものです、あなたが取り組んでいることは? – jmccarthy