Skip to content

Commit

Permalink
Handle alternative dismissals of error dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerg authored and Joerg committed Feb 22, 2014
1 parent f6c9528 commit b30077f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Augendiagnose/src/de/eisfeldj/augendiagnose/util/DialogUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}

/**
Expand Down

0 comments on commit b30077f

Please sign in to comment.