更新后ALLOW按钮不起作用 [英] ALLOW button not working after update

查看:231
本文介绍了更新后ALLOW按钮不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在已安装Android Marshmallow最新更新的设备上-

On the devices which have installed the latest update of Android Marshmallow - that is June2016 update, when I ask for permissions, the ALLOW button is not working.

我已经使用以下两种设备进行了测试:

I have tested with these 2 devices:

Nexus 6p(Andoid版本-6.0.1,内部版本号-MTC19V)

Nexus 6p (Andoid version - 6.0.1, Build number - MTC19V)

Nexus 7(Android版本6.0.1,内部版本号-MOB30M)

Nexus 7 (Android version 6.0.1, Build number - MOB30M)

两者均具有最新更新,当我请求权限时,会显示对话框,但我无法按ALLOW按钮.

Both have the latest update, and when I request permissions, the dialog is shown, but I'm not able to press the ALLOW button.

这是我用来请求权限的代码:

Here is the code, that I use to request permissions:

public void showPermissionsDialog() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        int hasWriteExternalStoragePermission = activity.checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
        int hasWriteGetAccountsPermission = activity.checkSelfPermission(android.Manifest.permission.GET_ACCOUNTS);

        if (hasWriteExternalStoragePermission != PackageManager.PERMISSION_GRANTED || hasWriteGetAccountsPermission != PackageManager.PERMISSION_GRANTED) {
            activity.requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE, android.Manifest.permission.GET_ACCOUNTS}, MainActivity.REQUEST_CODE_ASK_PERMISSIONS);
        } else {
            isAllPermissionsGranted = true;
        }
    } else {
        isAllPermissionsGranted = true;
    }

}



    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        if (requestCode == REQUEST_CODE_ASK_PERMISSIONS) {
            if (grantResults.length > 0) {
                boolean isAllPermissionsGranted = true;
                for (int i = 0; i < grantResults.length; i++) {
                    if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
                        isAllPermissionsGranted = false;
                    }
                }

                if (isAllPermissionsGranted) {
                    this.isAllPermissionsGranted = true;
                } else {
                    android.widget.Toast.makeText(this, "Please, grand permissions", android.widget.Toast.LENGTH_LONG).show();
                    showPermissionsDialog();
                }
            }
        }
    }

有关如何解决此问题的任何建议?预先感谢!

Any suggestions on how to fix this? Thanks in advance!

编辑

此处是Google的错误报告.我们仍在等待Google的修复.

Here is the bug report to Google. We're still waiting for the fix from Google.

编辑1

此问题已修复!

推荐答案

在上一个android系统中,它已被标记为缺陷,并将在以后的操作系统版本中修复. 错误报告

It has been marked as a defect in the last android and it will be fix in a future release of the OS. Bug report

文件管理器向我发送电子邮件,告知他们已在其应用程序中修复了此功能.我没有再尝试使用文件管理器,但是如果您更新应用程序,它应该不会再出现此问题.但基本上,这种行为可能是由于任何应用程序以错误的方式进行覆盖,直到Android对其进行修复为止.

我终于明白了(至少就我而言)...它的f ****

I finally got it (at least in my case)... its the f**** File Manager app's service. If its service is stopped, the permissions work again.

https://play.google.com/store/apps/details?id = com.rhmsoft.fm

我在更新到"MOB30M"之前拥有此应用,并且运行时权限正常运行(我的日常工作是对此进行编程),并且我一直在使用文件管理器将发行版APK放入手机并运行安装APK.我今天安装的某些应用也不是.

I had this app before the update to "MOB30M" and the runtime permissions where working without a problem (is my daily job to program this) and i have been using the file manager to put the release APK inside the phone and run it to install the APK. So is not some app that I installed today.

我最糟糕的是,一个应用程序会使所有权限系统崩溃.

What I fund awful is that one app can make crash all the permission system.

问题太多了

我了解到权限系统并未崩溃,因为可以使用一个应用程序来伪造对话框,但是Android(Google)不应告诉您您有一个在顶部运行的应用程序,并且您想授予该应用程序许可权,您应该卸载XXXX应用程序?我的意思是为了用户体验.

I understand that the permission system is not being crashed, since an app could be used to falsify the dialogs, BUT shouldn’t then Android (Google) tell you that you have an app that is running on the top and that if you want to give permissions to the app you should uninstall XXXX app? I mean for the sake of the User Experience.

普通用户会认为他的手机坏了,很可能会将手机发回给Google或运营商xD

A normal user, would think that his phone is broken and probably would send the phone back to google or the carrier xD

来吧,说实话,android不能让它变得更好吗?不像您需要植根于手机才能具有此行为(我的植株未植根).如果您不通知用户正在发生的事情,那么就好像坏了

Come on, let's be honest, cant android make this better? Is not like you need your phone rooted to have this behavior (my phone is not rooted). If you dont inform the user what's going on, then is like is broken

这篇关于更新后ALLOW按钮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆