Hej. Mam taki kod:
private void ALARM(){
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setMessage("NEED HELP?");
alert.setCancelable(false);
alert.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
notify();
});
alert.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
alert.show();
}
Chciałbym, aby w przypadku, kiedy użytkownik nie dokona wyboru, aplikacja automatycznie przyjęła, że wcisnięto YES.
Proszę o pomoc. O ile wywołanie metody dismiss() po upływie pewnego czasu nie jest problemem, to bardziej zastanawia mnie automatyczna obsługa tego buttona.