{"id":146,"date":"2023-02-18T20:40:57","date_gmt":"2023-02-18T12:40:57","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=146"},"modified":"2023-02-18T20:41:44","modified_gmt":"2023-02-18T12:41:44","slug":"android-jump-calls-and-direct-calls","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/18\/android-jump-calls-and-direct-calls\/","title":{"rendered":"Android \u62e8\u6253\u7535\u8bdd\uff08\u8df3\u8f6c\u62e8\u6253\u53ca\u76f4\u63a5\u62e8\u901a\uff09"},"content":{"rendered":"<p>\u8df3\u8f6c\u62e8\u6253\u9875\u9762\uff1a<code>Intent(Intent.ACTION_VIEW, Uri.parse(&quot;tel:10086&quot;))<\/code><br \/>\n\u76f4\u63a5\u62e8\u901a\u7535\u8bdd\uff1a<code>Intent(Intent.ACTION_CALL, Uri.parse(&quot;tel:10086&quot;))<\/code>  \/\/\u9700\u8981\u52a8\u6001\u6388\u6743<code>&lt;uses-permission android:name=&quot;android.permission.CALL_PHONE&quot; \/&gt;<\/code><\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-java\">CallPhonePromptDialogHelper.warnPrompt(AppBlogActivity.this, new CallPhonePromptDialogHelper.OnCallPhoneListener() {\n    @Override\n    public void onCallPhone() {\n        if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {\n            RxPermissionHelper.requestCallPhonePermissions(AppBlogActivity.this, new RxPermissionHelper.PermissionsCheckListener() {\n                @Override\n                public void onPermissionsGranted(int permissionType) {\n                    NLog.i(Constants.TAG, &quot;AppBlogActivity.onPermissionsGranted&quot;);\n                    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(&quot;tel:10086&quot;));\n                    if (checkSelfPermission(Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n                        return;\n                    }\n                    AppBlogActivity.this.startActivity(intent);\n                }\n\n                @Override\n                public void onPermissionsDenied(int permissionType) {\n                    NLog.i(Constants.TAG, &quot;AppBlogActivity.onPermissionsDenied&quot;);\n                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(&quot;tel:10086&quot;));\n                    AppBlogActivity.this.startActivity(intent);\n                }\n            });\n        } else {\n            \/\/ \u62e8\u53f7: \u6fc0\u6d3b\u7cfb\u7edf\u7684\u62e8\u53f7\u7ec4\u4ef6\n            Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(&quot;tel:10086&quot;));\n            AppBlogActivity.this.startActivity(intent);\n        }\n    }\n});<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8df3\u8f6c\u62e8\u6253\u9875\u9762\uff1aIntent(Intent.ACTION_VIEW, Uri.parse(&quot;tel:1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-android-basic"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}