Android/kotlin/Alert
提供: 初心者エンジニアの簡易メモ
okのみ
AlertDialog.Builder(context) .setTitle("タイトル1") .setMessage("文章1") .setPositiveButton("OK") { dialog, which -> Log.i("AlertDialog", "OK") } .show()
ok,cancelの2択
AlertDialog.Builder(context) .setTitle("タイトル1") .setMessage("文章1") .setPositiveButton("OK") { dialog, which -> Log.i("AlertDialog", "OK") } .setNegativeButton("Cancel"){ dialog, which -> Log.i("AlertDialog", "Cancel") } .show()