{"id":1598,"date":"2016-06-02T15:13:21","date_gmt":"2016-06-02T07:13:21","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1598"},"modified":"2020-04-15T22:24:55","modified_gmt":"2020-04-15T14:24:55","slug":"%e5%9c%a8android-6-0-%e8%ae%be%e5%a4%87%e4%b8%8a%e5%8a%a8%e6%80%81%e8%8e%b7%e5%8f%96%e6%9d%83%e9%99%90","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1598","title":{"rendered":"\u5728Android 6.0 \u8bbe\u5907\u4e0a\u52a8\u6001\u83b7\u53d6\u6743\u9650"},"content":{"rendered":"<p><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/04\/201407311445259040063.jpg\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2826\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/04\/201407311445259040063.jpg\" alt=\"20140731144525904006\" width=\"383\" height=\"268\" \/><\/a><\/p>\n<p>\u4f17\u6240\u5468\u77e5\uff0cAndroid 6.0 \u76f8\u6bd4\u4e4b\u524d\u7684Android\u7248\u672c\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u4e0d\u540c\u70b9\uff0c\u5c31\u662f\u52a8\u6001\u83b7\u53d6\u6743\u9650\u3002\u4eca\u5929\u81ea\u5df1\u5728\u505a\u62e8\u53f7\u529f\u80fd\u65f6\uff0c\u6b63\u5de7\u9047\u5230\u8fd9\u4e2a\u95ee\u9898\uff0c \u987a\u624b\u8bb0\u5f55\u4e0b\u5728Android 6.0 \u4e0a\u5982\u4f55\u52a8\u6001\u83b7\u53d6\u6743\u9650\u3002<\/p>\n<p>\u4e0b\u9762\u4ece\u81ea\u5df1\u4e00\u5f00\u59cb\u7684\u95ee\u9898\u5165\u624b<\/p>\n<p>###\u5b9e\u73b0\u62e8\u53f7\u529f\u80fd<\/p>\n<p>\u8bf4\u5230\u62e8\u53f7\uff0c\u4e00\u4e2a Intent \u5c31\u641e\u5b9a\uff0c\u4ee3\u7801\u5982\u4e0b\uff0c<\/p>\n<div class=\"highlighter-rouge\">\n<pre class=\"highlight\"><code class=\"hljs cpp\">   <span class=\"hljs-function\"><span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">callDirectly<\/span><span class=\"hljs-params\">(String mobile)<\/span><\/span>{\r\n        Intent intent = <span class=\"hljs-keyword\">new<\/span> Intent();\r\n        intent.setAction(<span class=\"hljs-string\">\"android.intent.action.CALL\"<\/span>);\r\n        intent.setData(Uri.parse(<span class=\"hljs-string\">\"tel:\"<\/span> + mobile));\r\n        mContext.startActivity(intent);\r\n    }\r\n<\/code><\/pre>\n<\/div>\n<p>\u5f53\u7136 \u4f60\u53ef\u522b\u5fd8\u4e86\u5728 Manifest \u6587\u4ef6\u4e2d\u53bb\u58f0\u660e\u62e8\u53f7\u7684\u6743\u9650<\/p>\n<div class=\"highlighter-rouge\">\n<pre class=\"highlight\"><code class=\"hljs css\">   &lt;<span class=\"hljs-tag\">uses-permission<\/span> <span class=\"hljs-rule\"><span class=\"hljs-attribute\">android<\/span>:<span class=\"hljs-value\">name=<span class=\"hljs-string\">\"android.permission.CALL_PHONE\"<\/span> \/&gt;\r\n<\/span><\/span><\/code><\/pre>\n<\/div>\n<p>###\u95ee\u9898<\/p>\n<p>\u5982\u679c\u5728 Android 6.0 \u4ee5\u524d\u7684\u8bbe\u5907\u4e0a\uff0c\u4e0a\u9762\u7684\u4ee3\u7801\u90fd\u662f\u6ca1\u6709\u95ee\u9898\u7684\uff0c\u4f46\u662f\u5982\u679c\u662f\u5728 Android 6.0 \u8bbe\u5907\u4e0a\uff0c\u5e76\u4e14\u9879\u76ee\u7684 targetSdkVersion \u4f60\u8bbe\u7f6e\u7684\u662f23\uff0c\u90a3\u4e48 \u5f53\u4f60\u6267\u884c\u4e0a\u9762\u7684\u62e8\u53f7\u4ee3\u7801\u65f6\uff0c\u7a0b\u5e8f\u5c06\u4f1a\u5954\u6e83\u6389\u3002<\/p>\n<p>\u6b64\u65f6\u4f60\u80af\u5b9a\u60f3\u5230\u4e86 \u5982\u679c targetSdkVersion \u503c\u8bbe\u7f6e\u7684\u5c0f\u4e8e23\u662f\u4e0d\u662f\u5c31\u4e0d\u4f1a\u5954\u6e83\u4e86\uff0c\u6069\uff0c\u786e\u5b9e\u5982\u6b64\uff0c \u6b64\u65f6\u5373\u4f7f\u4f7f\u7528Android6.0\u7684\u8bbe\u5907\uff0c\u7a0b\u5e8f\u4e5f\u4e0d\u4f1a\u5954\u6e83\uff0c\u539f\u56e0\u663e\u800c\u6613\u89c1\uff0cAndroid \u7684\u6743\u9650\u673a\u5236\u662f Android M \u540e\u624d\u52a0\u5165\u7684\u3002\u4ece Android M \u5f00\u59cb \u5e94\u7528\u7a0b\u5e8f\u7533\u8bf7\u7684\u6743\u9650\u662f\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u8d4b\u7ed9\u7528\u6237\u7684\u3002<\/p>\n<p>\u5173\u4e8e\u52a8\u6001\u5206\u914d\u6743\u9650\uff0c\u4e00\u4e9b\u540c\u5b66\u53ef\u80fd\u4e0d\u662f\u5f88\u6e05\u695a\u3002\u8fd9\u91cc\u7a0d\u7a0d\u63d0\u4e00\u4e0b Android 6.0 \u7684<a href=\"http:\/\/gudong.name\/%E6%8A%80%E6%9C%AF\/2015\/11\/10\/android_m_permission.html#permission\">\u6743\u9650\u52a8\u6001\u5206\u914d<\/a>\u3002 \u5982\u679c\u4f60\u53ea\u5bf9\u6700\u7ec8\u7684\u89e3\u51b3\u65b9\u6848\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u8df3\u8fc7\u4e0b\u9762\u8fd9\u8282\uff0c\u76f4\u63a5\u53bb\u770b<a href=\"http:\/\/gudong.name\/%E6%8A%80%E6%9C%AF\/2015\/11\/10\/android_m_permission.html#answer\">\u89e3\u51b3\u65b9\u6848<\/a><\/p>\n<p>###<a name=\"permission\"><\/a>\u6743\u9650\u52a8\u6001\u5206\u914d ###<\/p>\n<p>\u5728 Android6.0 \u4e4b\u524d\uff0c\u4e0b\u8f7d\u597d\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\uff0c\u70b9\u51fb\u5b89\u88c5\u6211\u4eec\u770b\u5230\u7684\u5927\u90fd\u662f\u50cf\u8fd9\u6837\u7684\u754c\u9762\u3002<\/p>\n<p><img decoding=\"async\" title=\"permission\" src=\"http:\/\/gudong.name\/assets\/android_m_install.jpg\" alt=\"permission\" \/><\/p>\n<p>\u4e0a\u56fe\u5206\u522b\u662fNexus6\u548c\u5c0f\u7c73\u624b\u673a\u5728\u5b89\u88c5\u8f6f\u4ef6\u65f6\u7684\u754c\u9762\u3002<\/p>\n<p>\u5728\u5b89\u88c5\u65f6\u4f60\u4f1a\u53d1\u73b0\uff0c\u624b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u63d0\u793a\uff0c\u8fd9\u4e2a\u8f6f\u4ef6\u4f1a\u7d22\u8981\u4e86\u4f60\u624b\u673a\u7684\u90a3\u4e9b\u6743\u9650\uff0c\u5e76\u4e14\u7ed9\u7528\u4e00\u4e2a\u5217\u8868\u8fdb\u884c\u5c55\u793a\uff0c\u4f46\u662f\u8fd9\u4e9b\u63d0\u793a\u53ea\u662f\u5728\u5b89\u88c5\u662f\u63d0\u793a\uff0c\u53ea\u8981\u4f60\u70b9\u51fb\u63a5\u53d7\u6216\u8005\u5b89\u88c5\uff0c \u8868\u793a\u4f60\u5141\u8bb8\u8fd9\u4e2a\u5e94\u7528\u5728\u53ef\u4ee5\u83b7\u53d6\u5b83\u7533\u660e\u7684\u6240\u6709\u6743\u9650\u3002\u4e00\u822c\u5f88\u5c11\u6709\u4eba\u5728\u5b89\u88c5\u65f6\uff0c\u4f1a\u56e0\u4e3a\u770b\u5230\u67d0\u4e2a\u5e94\u7528\u56e0\u4e3a\u7533\u8bf7\u4e86\u67d0\u4e00\u4e2a\u654f\u611f\u6743\u9650\u800c\u653e\u5f03\u5b89\u88c5\u5e94\u7528\u3002\u56e0\u4e3a\u8fd9\u4e2a\u6743\u9650\u867d\u7136\u654f\u611f\uff0c \u4f46\u662f\u5bf9\u4e8e\u5f53\u524d\u7684\u7528\u6237\u662f\u4e0d\u53ef\u611f\u77e5\u7684\uff0c\u56e0\u4e3a\u4ed6\u73b0\u5728\u5e76\u6ca1\u6709\u7acb\u5373\u53bb\u67e5\u770b\u4f60\u7684\u6700\u8fd1\u901a\u8bdd\u3001\u77ed\u4fe1\u8bb0\u5f55\u2026<\/p>\n<p>\u8bf4\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u81ea\u7136\u800c\u7136\u7684\u4f1a\u60f3\u5230\uff0c\u5176\u5b9e\u6700\u597d\u7684\u65b9\u5f0f\u662f\uff0c\u5f53\u8fd9\u4e2a\u5e94\u7528\u5728\u7528\u6237\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u6b63\u51c6\u5907\u4f7f\u7528\u67d0\u4e2a\u6743\u9650\u65f6\uff0c\u6bd4\u5982\u8bf4\u8bfb\u53d6\u77ed\u4fe1\u5217\u8868\uff0c\u7cfb\u7edf\u80fd\u53ca\u65f6\u7684\u5f39\u51fa\u4e00\u4e2a\u63d0\u793a\u6846\uff0c\u8bf4\u8fd9\u4e2a\u5e94\u7528\u8981\u8bfb\u53d6\u60a8\u7684\u77ed\u4fe1\u5185\u5bb9\uff0c \u60a8\u662f\u5426\u5141\u8bb8\u3002\u7136\u540e\u7528\u6237\u7ed3\u5408\u5f53\u524d\u5e94\u7528\u7684\u6267\u884c\u52a8\u4f5c\uff0c\u4f9d\u636e\u5f53\u524d\u6761\u4ef6\u5224\u65ad\uff0c\u662f\u4e0d\u662f\u5e94\u8be5\u6388\u4e88\u5e94\u7528\u8bfb\u53d6\u77ed\u4fe1\u8bb0\u5f55\u7684\u6743\u9650\u3002\u8fd9\u7edd\u5bf9\u7684\u6700\u5b8c\u7f8e\u7684\u3002 \u56e0\u4e3a\u5728\u5177\u4f53\u7684\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u7ed3\u5408\u5f53\u524d\u5e94\u7528\u7684\u4f7f\u7528\u573a\u666f\uff0c\u53bb\u601d\u8003\u3001\u5224\u65ad\u662f\u4e0d\u662f\u5e94\u8be5\u7ed9\u8fd9\u4e2a\u5e94\u7528\u76f8\u5e94\u7684\u6743\u9650\u3002\u4e0d\u7ed9\u80fd\u600e\u6837\uff0c\u7ed9\u4e86\u4f1a\u600e\u6837\uff0c \u8fd9\u6837\u5bf9\u7528\u6237\u800c\u8a00\uff0c\u5b8c\u5168\u662f\u4e3b\u52a8\u7684\uff0c\u76f8\u6bd4\u5b89\u88c5\u65f6\u90a3\u79cd\u9009\u62e9\uff0c\u8fd9\u6837\u7684\u505a\u6cd5\u65e0\u7591\u662f\u5bf9\u7528\u6237\u83ab\u5927\u7684\u5c0a\u91cd\uff0c\u540c\u65f6\u8fd9\u4e5f\u4fdd\u8bc1\u4e86\u7528\u6237\u7684\u4e2a\u4eba\u9690\u79c1\u3002<\/p>\n<p>\u8bf4\u5230\u8fd9\u91cc\uff0c\u4e0d\u5f97\u4e0d\u63d2\u4e00\u53e5\uff0c\u5176\u5b9e MIUI \u65e9\u5c31\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u7cfb\u7edf\u7279\u6027\uff0c\u5728\u8fd9\u4e00\u70b9\u4e0a MIUI \u786e\u5b9e\u8d70\u5230\u4e86 Android\u56e2\u961f\u7684\u524d\u9762\uff0c\u6069\uff0c\u7ed9 MIUI \u70b9\u4e2a\u8d5e\u3002<\/p>\n<p>\u7136\u800c\u76f4\u5230 Android 6.0 \u8fd9\u4e2a\u7248\u672c\u5f00\u59cb\uff0c\u4e0a\u9762\u7684\u5047\u8bbe\u7ec8\u4e8e\u5f97\u5230\u4e86\u8c37\u6b4c\u7684\u5b9e\u8df5\uff0c\u9664\u4e86\u5728\u5e94\u7528\u5b89\u88c5\u65f6\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u63d0\u793a\u5e94\u7528\u4f1a\u83b7\u53d6\u90a3\u4e9b\u6743\u9650\uff0c\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u5f53\u5e94\u7528\u53bb\u771f\u7684\u83b7\u53d6\u4e00\u4e9b\u654f\u611f \u6743\u9650\u65f6\uff0c\u7cfb\u7edf\u8fd8\u4f1a\u5f39\u51fa\u4e00\u4e2a\u63d0\u793a\u6846\uff0c\u8be2\u95ee\u7528\u6237\u662f\u4e0d\u662f\u6388\u4e88\u5e94\u7528\u76f8\u5e94\u7684\u6743\u9650\u3002\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n<p><img decoding=\"async\" title=\"permission\" src=\"http:\/\/gudong.name\/assets\/android_m_sms.jpeg\" alt=\"permission\" \/><\/p>\n<p>\u8fd9\u5c31\u662f Android 6.0 \u7684\u8fd0\u884c\u65f6\u6743\u9650\u68c0\u67e5\u673a\u5236\u3002\u4e0b\u9762\u662fGoogle\u5b98\u65b9\u5bf9\u6b64\u7684\u89e3\u91ca\uff0c\u53ea\u622a\u53d6\u4ecb\u7ecd\u90e8\u5206<\/p>\n<p>Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app&#8217;s functionality; for example, a user could choose to give a camera app access to the camera but not to the device location. The user can revoke the permissions at any time, by going to the app&#8217;s Settings screen.<\/p>\n<p>###\u89e3\u51b3\u65b9\u6848 ###<\/p>\n<p>\u5176\u5b9e\u4e0a\u9762\u5df2\u7ecf\u8bf4\u4e86\u4e00\u79cd\u53d6\u5de7\u7684\u65b9\u6848\uff0c\u5c06 targetSdkVersion \u8bbe\u4e3a\u5c0f\u4e8e23\u7684\u503c\uff0c\u7a0b\u5e8f\u5c06\u4e0d\u4f1a\u5954\u6e83\uff0c \u4f46\u662f\u5728Android 6.0 \u4e0a\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4f9d\u65e7\u62e8\u4e0d\u4e86\u7535\u8bdd\uff0c\u8fd9\u662f\u771f\u7684\u3002\u6240\u4ee5\u8981\u60f3\u517c\u5bb96.0\u7248\u672c\uff0c\u5fc5\u987b\u901a\u8fc7\u4e0b\u9762\u7684\u65b9\u5f0f\u8fdb\u884c\u4ee3\u7801\u5c42\u9762\u7684\u517c\u5bb9\u3002<\/p>\n<p>\u5bf9Android\u7248\u672c\u505a\u5224\u65ad\uff0c\u7136\u540e\u5bf9Android 6.0 \u505a\u7279\u6b8a\u5904\u7406\uff0c\u4ee3\u7801\u5982\u4e0b<\/p>\n<div class=\"highlighter-rouge\">\n<pre class=\"highlight\"><code class=\"hljs java\"> <span class=\"hljs-keyword\">final<\/span> <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-keyword\">int<\/span> REQUEST_CODE_ASK_CALL_PHONE = <span class=\"hljs-number\">123<\/span>;\r\n\r\n <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">onCall<\/span><span class=\"hljs-params\">(String mobile)<\/span><\/span>{\r\n        <span class=\"hljs-keyword\">this<\/span>.mMobile = mobile;\r\n        <span class=\"hljs-keyword\">if<\/span> (Build.VERSION.SDK_INT &gt;= <span class=\"hljs-number\">23<\/span>) {\r\n            <span class=\"hljs-keyword\">int<\/span> checkCallPhonePermission = ContextCompat.checkSelfPermission(mContext,Manifest.permission.CALL_PHONE);\r\n            <span class=\"hljs-keyword\">if<\/span>(checkCallPhonePermission != PackageManager.PERMISSION_GRANTED){\r\n                ActivityCompat.requestPermissions(mContext,<span class=\"hljs-keyword\">new<\/span> String[]{Manifest.permission.CALL_PHONE},REQUEST_CODE_ASK_CALL_PHONE);\r\n                <span class=\"hljs-keyword\">return<\/span>;\r\n            }<span class=\"hljs-keyword\">else<\/span>{\r\n                <span class=\"hljs-comment\">\/\/\u4e0a\u9762\u5df2\u7ecf\u5199\u597d\u7684\u62e8\u53f7\u65b9\u6cd5<\/span>\r\n                callDirectly(mobile);\r\n            }\r\n        } <span class=\"hljs-keyword\">else<\/span> {\r\n            <span class=\"hljs-comment\">\/\/\u4e0a\u9762\u5df2\u7ecf\u5199\u597d\u7684\u62e8\u53f7\u65b9\u6cd5<\/span>\r\n            callDirectly(mobile);\r\n        }\r\n    }\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b64\u65f6\uff0c\u5982\u679c\u4e00\u4e2aAndroid6.0\u7684\u7528\u6237\u89e6\u53d1\u62e8\u53f7\u52a8\u4f5c\uff0c\u6267\u884c\u4e0a\u9762\u7684\u4ee3\u7801\uff0c\u90a3\u4e48\u4ed6\u5c06\u4f1a\u770b\u5230\u4e00\u4e2a\u5f88\u597d\u770b\u7684MaterialDialog\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n<p><img decoding=\"async\" title=\"permission\" src=\"http:\/\/gudong.name\/assets\/android_m_permission.jpeg\" alt=\"permission\" \/><\/p>\n<p>\u90a3\u4e48\u7528\u6237\u70b9\u51fb\u62d2\u7edd\u6216\u8005\u5141\u8bb8\uff0c\u6211\u4eec\u600e\u4e48\u624d\u80fd\u62ff\u5230\u56de\u8c03\u5462\uff0c\u5982\u679c\u80fd\u62ff\u5230\u56de\u8c03\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u6839\u636e\u7528\u6237\u7684\u9009\u62e9\u6765\u6267\u884c\u4e0d\u540c\u7684\u64cd\u4f5c\u4e86\u3002<\/p>\n<p>\u8fd9\u91cc\u5e94\u8be5\u4f1a\u770b\u5230\u5728 ActivityCompat \u7684 requestPermissions \u65b9\u6cd5\u4e2d\uff0c\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u662f\u4e00\u4e2arequestCode\uff0c\u770b\u5230\u5b83\u81ea\u7136\u800c\u7136\u60f3\u5230\u4e86\u7ecf\u5e38\u7528\u5230\u7684onActivityResult\uff0c \u8fd9\u91cc\u5f53\u6267\u884c ActivityCompat \u7684 requestPermissions \u65b9\u6cd5\u540e\u6709\u4e00\u4e2a\u56de\u8c03\u673a\u5236\uff0c\u9700\u8981\u6211\u4eec\u5728\u5f53\u524d Activity \u4e2d\u5b9e\u73b0 onRequestPermissionsResult \u8fd9\u4e2a\u65b9\u6cd5\uff0c\u5177\u4f53\u5982\u4e0b<\/p>\n<div class=\"highlighter-rouge\">\n<pre class=\"highlight\"><code class=\"hljs java\">    <span class=\"hljs-annotation\">@Override<\/span>\r\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">onRequestPermissionsResult<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">int<\/span> requestCode, String[] permissions, <span class=\"hljs-keyword\">int<\/span>[] grantResults)<\/span> <\/span>{\r\n        <span class=\"hljs-keyword\">switch<\/span> (requestCode) {\r\n            <span class=\"hljs-keyword\">case<\/span> REQUEST_CODE_ASK_CALL_PHONE:\r\n                <span class=\"hljs-keyword\">if<\/span> (grantResults[<span class=\"hljs-number\">0<\/span>] == PackageManager.PERMISSION_GRANTED) {\r\n                    <span class=\"hljs-comment\">\/\/ Permission Granted<\/span>\r\n                    callDirectly(mobile);\r\n                } <span class=\"hljs-keyword\">else<\/span> {\r\n                    <span class=\"hljs-comment\">\/\/ Permission Denied<\/span>\r\n                    Toast.makeText(MainActivity.<span class=\"hljs-keyword\">this<\/span>, <span class=\"hljs-string\">\"CALL_PHONE Denied\"<\/span>, Toast.LENGTH_SHORT)\r\n                            .show();\r\n                }\r\n                <span class=\"hljs-keyword\">break<\/span>;\r\n            <span class=\"hljs-keyword\">default<\/span>:\r\n                <span class=\"hljs-keyword\">super<\/span>.onRequestPermissionsResult(requestCode, permissions, grantResults);\r\n        }\r\n    }\r\n<\/code><\/pre>\n<\/div>\n<p>\u8fd9\u91cc\u4f1a\u5bf9\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5bf9\u7528\u6237\u70b9\u51fb\u505a\u5224\u65ad\u7684\u5165\u53e3\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e grantResults[0] \u7684\u7c7b\u578b\uff0c\u6765\u5224\u65ad\u7528\u6237\u70b9\u51fb\u7684\u662f\u5141\u8bb8\u8fd8\u662f\u62d2\u7edd\uff0c\u63a5\u7740\u5c31\u53ef\u4ee5\u6267\u884c\u76f8\u5e94\u7684\u903b\u8f91\u4e86\u3002<\/p>\n<h3 id=\"section\">\u6709\u7528\u7684\u94fe\u63a5<\/h3>\n<p>\u5173\u4e8eAndroidM\u4e0a\u6743\u9650\u7684\u52a8\u6001\u83b7\u53d6\uff0c\u8fd9\u91cc\u53ea\u7ed9\u51fa\u4e86\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5c3d\u5174\uff0c\u90a3\u4e48\u4e0b\u9762\u8fd9\u7bc7\u56fd\u5916\u7684\u535a\u6587\uff0c\u4e00\u5b9a\u4f1a\u8ba9\u4f60\u6ee1\u8db3\u3002<\/p>\n<p><a href=\"http:\/\/inthecheesefactory.com\/blog\/things-you-need-to-know-about-android-m-permission-developer-edition\/en\">Everything every Android Developer must know about new Android\u2019s Runtime Permission<\/a><\/p>\n<p>\u8fd9\u7bc7\u82f1\u6587\u535a\u6587\u5185\u5bb9\u5f88\u957f\u3001\u5185\u5bb9\u4e5f\u6bd4\u8f83\u591a\uff0c\u5341\u8db3\u7684\u5e72\u8d27\u3002\u60a8\u6162\u7528~<\/p>\n<p>\u540e\u8bb0\uff1a\u5076\u7136\u53d1\u73b0\u5df2\u7ecf\u6709\u54e5\u4eec\u628a\u4e0a\u9762\u7684\u8fd9\u7bc7\u6587\u7ae0\u505a\u4e86\u7ffb\u8bd1\uff0c\u771f\u662f\u6781\u597d\u7684\uff0c\u9644\u4e0a<a href=\"http:\/\/jijiaxin89.com\/2015\/08\/30\/Android-s-Runtime-Permission\/\">\u7ffb\u8bd1\u94fe\u63a5<\/a>\uff0c\u7ed9\u7ffb\u8bd1\u8005\u540c\u5b66\u70b9\u8d5e\uff0c\u8f9b\u82e6\uff01<\/p>\n<p>\u53e6\u5916\uff0c\u6700\u8fd1\u770b\u5230\u4e00\u4e2aGithub\u4e0a\u7684\u5f00\u6e90\u9879\u76ee <a href=\"https:\/\/github.com\/k0shk0sh\/PermissionHelper\">PermissionHelper<\/a> \uff0c\u4e13\u95e8\u7528\u4e8e\u5904\u7406 Android 6.0 \u7684\u6743\u9650\u517c\u5bb9\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u51fa\u81ea\u00a0<a href=\"http:\/\/maoruibin.github.io\/\" target=\"_self\">\u5495\u549a<\/a>\u00a0 \u7684\u535a\u5ba2\uff1a<a href=\"http:\/\/maoruibin.github.io\/%E6%8A%80%E6%9C%AF\/2015\/11\/10\/android_m_permission.html\" target=\"_self\">\u5728Android 6.0 \u8bbe\u5907\u4e0a\u52a8\u6001\u83b7\u53d6\u6743\u9650<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f17\u6240\u5468\u77e5\uff0cAndroid 6.0 \u76f8\u6bd4\u4e4b\u524d\u7684Android\u7248\u672c\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u4e0d\u540c\u70b9\uff0c\u5c31\u662f\u52a8\u6001\u83b7\u53d6\u6743\u9650\u3002\u4eca\u5929\u81ea\u5df1\u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[84],"tags":[],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1598"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1598"}],"version-history":[{"count":6,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1598\/revisions"}],"predecessor-version":[{"id":2841,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1598\/revisions\/2841"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}