if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
final AlertDialog.Builder adb = new AlertDialog.Builder(this);
adb.setTitle("App permissions");
adb.setMessage("Click on ok then app will redirect to app settings then please click on Other Permissions and Please Allow All");
adb.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivity(intent);
}
});
adb.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
finishAffinity();
dialogInterface.dismiss();
}
});
adb.show();
}
2条答案
按热度按时间u91tlkcl1#
也许你会很幸运,有人可以证明我错了,但似乎在最近版本的Android上,你只限于应用程序设置-没有通过意图直接访问应用程序权限。
我相信这与安全和自动化有关,这也与Google在尝试请求权限时显示“检测到覆盖”警告的决定一致as outlined on this non-Google article
jm81lzqq2#