From b30077fd6ff6f9ff8abb38421436fa39eb7283cd Mon Sep 17 00:00:00 2001 From: Joerg Date: Sat, 22 Feb 2014 22:06:56 +0100 Subject: [PATCH] Handle alternative dismissals of error dialogs --- .../eisfeldj/augendiagnose/util/DialogUtil.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Augendiagnose/src/de/eisfeldj/augendiagnose/util/DialogUtil.java b/Augendiagnose/src/de/eisfeldj/augendiagnose/util/DialogUtil.java index 182cf193..1ecee883 100644 --- a/Augendiagnose/src/de/eisfeldj/augendiagnose/util/DialogUtil.java +++ b/Augendiagnose/src/de/eisfeldj/augendiagnose/util/DialogUtil.java @@ -9,7 +9,6 @@ import android.os.Bundle; import android.text.Html; import android.util.Log; -import android.view.KeyEvent; import android.widget.Toast; import de.eisfeldj.augendiagnose.Application; import de.eisfeldj.augendiagnose.R; @@ -169,18 +168,16 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { public void onClick(DialogInterface dialog, int id) { getActivity().finish(); } - }).setOnKeyListener(new DialogInterface.OnKeyListener() { - @Override - public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK) { - getActivity().finish(); - return true; - } - return false; - } }); + return builder.create(); } + + @Override + public void onDismiss(DialogInterface dialog) { + super.onDismiss(dialog); + getActivity().finish(); + } } /**