mirror of
https://github.com/jamessanford/kegs.git
synced 2025-01-08 13:29:49 +00:00
Exit app if user cancels mandatory dialog.
This commit is contained in:
parent
c32a835a56
commit
af1cb6ef89
@ -5,7 +5,6 @@ import android.util.Log;
|
||||
import java.io.File;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
|
@ -175,6 +175,12 @@ public class KegsMain extends Activity implements KegsKeyboard.StickyReset, Asse
|
||||
dialog.setCanceledOnTouchOutside(false); // lame
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
class ErrorDialogFragment extends DialogFragment {
|
||||
@ -186,6 +192,18 @@ public class KegsMain extends Activity implements KegsKeyboard.StickyReset, Asse
|
||||
// TODO setCanceledOnTouchOutside(false) ? otherwise can accidentally dismiss the error.
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
class AssetFragment extends DialogFragment {
|
||||
|
@ -29,4 +29,10 @@ public class RomDialogFragment extends DialogFragment {
|
||||
dialog.setCanceledOnTouchOutside(false); // lame
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
((KegsMain)getActivity()).finish();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user