fix: request storage permission without the need of closing the app, if it is the first time installing the app it will crash since it can't find any iwad to start the game.

This commit is contained in:
Emanuele Disco 2022-12-08 20:12:02 +09:00
parent 03c18de737
commit 70c131378d

View file

@ -151,8 +151,13 @@ import java.io.OutputStream;
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] results) {
if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION_ID) {
finish();
System.exit(0);
if (results.length > 0 && results[0] == PackageManager.PERMISSION_GRANTED) {
create();
}
else {
finish();
System.exit(0);
}
}
}