Add a popup for when permissions are not accepted
Despite it being obvious that to play games from the sdcard, you need to access the sdcard, mistakes can happen.
This commit is contained in:
parent
a2eed6bb06
commit
b909c4247b
|
|
@ -563,6 +563,23 @@ public class MainActivity extends AppCompatActivity implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(
|
||||
int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
|
||||
if (requestCode == PERMISSION_REQUEST) {
|
||||
if (!(grantResults.length > 0 && grantResults[0]
|
||||
== PackageManager.PERMISSION_GRANTED)) {
|
||||
StringBuilder disabled = new StringBuilder();
|
||||
for (String permission : permissions) {
|
||||
disabled.append("\n");
|
||||
disabled.append(permission);
|
||||
}
|
||||
showToastMessage(getString(R.string.permission_blocked,
|
||||
disabled.toString()), Snackbar.LENGTH_LONG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCallable(Intent intent) {
|
||||
List<ResolveInfo> list = getPackageManager().queryIntentActivities(
|
||||
intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
<string name="config_home">Please configure a home directory.</string>
|
||||
<string name="config_data">Please move BIOS to %1$s/data/</string>
|
||||
<string name="config_game">Please configure a game directory.</string>
|
||||
<string name="permission_blocked">Permission(s) blocked:%1$s</string>
|
||||
<string name="unsupported">Unsupported kernel version!</string>
|
||||
<string name="locate">Locate</string>
|
||||
<string name="browse">Browse</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue