1
I created this code to close app for it instead of closing reboot. I have Mainactivity and the first one has a splash screen. What I have to change .
public void existeapp (View View ){ existeapp(); }
private void existeapp() {
AlertDialog.Builder builder = new AlertDialog.Builder(Main2Activity.this);
builder.setMessage("Do you want to exit?");
builder.setCancelable(true);
builder.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
System.exit(0);
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
thank you very much xD
– sergiopm