Marshmallow权限弹出窗口隐藏了片段UI

时间:2016-11-09 09:41:15

标签: android android-6.0-marshmallow android-permissions

我的应用程序要求父活动中的权限,而片段已显示给用户

当app请求权限时,后台变为完全白色我想在片段顶部显示权限对话框但不覆盖全屏

有什么想法吗?

下面添加代码
int finePermission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);
        List<String> listPermissionsNeeded = new ArrayList<>();
        if (finePermission != PackageManager.PERMISSION_GRANTED) {
            listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);
            listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);
        }
        if (!listPermissionsNeeded.isEmpty()) {
            ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), PERMISSION_CODE);

        }

screenshot

1 个答案:

答案 0 :(得分:-3)

将此行添加到对话框

 dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));