new AlertDialog.Builder(this)
.setIcon(R.drawable.ic_launcher)
.setTitle(R.string.dialog_title_quit)
.setMessage(R.string.dialog_msg_quit).setNegativeButton(R.string.no, null)
.setPositiveButton(R.string.yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
YourClass.this.finish();
}
})
.show();
Reference
Confirming & Acknowledging | Android Design
Android 最詳細的對話框教學
沒有留言 :
張貼留言