Android de AlertDialog Çıkış Uyarısı
@Override
public void onBackPressed() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Mesut Abi Dur Çıkma?")
.setCancelable(false)
.setPositiveButton("Yoh çıkacam", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MainActivity.this.finish();
}
})
.setNegativeButton("Tamam Senimi Kıracam", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
Hiç yorum yok:
Yorum Gönder