{"id":4959,"date":"2021-09-29T15:32:26","date_gmt":"2021-09-29T07:32:26","guid":{"rendered":"http:\/\/122.152.205.50\/wordpress\/?p=4959"},"modified":"2021-10-07T15:27:44","modified_gmt":"2021-10-07T07:27:44","slug":"%e7%b3%bb%e7%bb%9f%e5%88%86%e4%ba%ab%e9%9d%a2%e6%9d%bf%e7%95%8c%e9%9d%a2%e6%ba%90%e7%a0%81","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=4959","title":{"rendered":"android6.0 \u7cfb\u7edf\u5206\u4eab\u9762\u677f\u754c\u9762\u6e90\u7801"},"content":{"rendered":"<h3>\u4e00\u3001\u7cfb\u7edf\u5206\u4eab\u9762\u677f\u754c\u9762\u5165\u53e3<\/h3>\n<p>\u6253\u5f00Git\u547d\u4ee4\u884c\uff0c\u8f93\u5165<code>adb shell dumpsys activity | grep \"Running activities\" -A 7<\/code>\u53ef\u4ee5\u5f97\u77e5\u5206\u4eab\u9762\u677f\u7684\u754c\u9762\u7c7b\u4e3aChooserActivity\u3002<br \/>\n- ChooserActivity\u662f\u5982\u4f55\u88ab\u542f\u52a8\u7684<br \/>\n\u901a\u8fc7\u67e5\u770b\u6d4f\u89c8\u5668\u5e94\u7528<code>\/packages\/apps\/Browser<\/code>\u6e90\u7801<code>\/packages\/apps\/Browser\/src\/com\/android\/browser\/Controller.java<\/code><\/p>\n<pre><code class=\"language-java line-numbers\">static final void sharePage(Context c, String title, String url,\n                                Bitmap favicon, Bitmap screenshot) {\n        Intent send = new Intent(Intent.ACTION_SEND);\n        send.setType(\"text\/plain\");\n        send.putExtra(Intent.EXTRA_TEXT, url);\n        send.putExtra(Intent.EXTRA_SUBJECT, title);\n        send.putExtra(Browser.EXTRA_SHARE_FAVICON, favicon);\n        send.putExtra(Browser.EXTRA_SHARE_SCREENSHOT, screenshot);\n        try {\n            c.startActivity((send, c.getString(\n                    R.string.choosertitle_sharevia)));\n        } catch (android.content.ActivityNotFoundException ex) {\n            \/\/ if no app handles it, do nothing\n        }\n    }\n<\/code><\/pre>\n<p>Intent.createChooser()\u65b9\u6cd5\u542f\u52a8action\u4e3a\"android.intent.action.CHOOSER\"\u7684activity\uff0c\u4e5f\u5c31\u662fChooserActivity.java\u3002<\/p>\n<ul>\n<li>ChooserActivity.java<br \/>\n\u6e90\u7801\u4f4d\u7f6e\uff1a<br \/>\n<code>\/frameworks\/base\/core\/java\/com\/android\/internal\/app\/ChooserActivity.java<\/code><br \/>\n>\u53ef\u8df3\u8f6c\u7684\u5e94\u7528\u662f\u5982\u4f55\u52a0\u8f7d\u7684\uff1f<br \/>\n\/\/TODO<\/li>\n<\/ul>\n<blockquote><p>\n  \u70b9\u51fb\u5e94\u7528\u505a\u4e86\u5565\uff1f<br \/>\n  \/\/TODO<br \/>\n  - ResolverActivity.java<br \/>\n  \u6e90\u7801\u4f4d\u7f6e\uff1a<code>\/frameworks\/base\/core\/java\/com\/android\/internal\/app\/ResolverActivity.java<\/code>\n<\/p><\/blockquote>\n<button class=\"simplefavorite-button\" data-postid=\"4959\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u7cfb\u7edf\u5206\u4eab\u9762\u677f\u754c\u9762\u5165\u53e3 \u6253\u5f00Git\u547d\u4ee4\u884c\uff0c\u8f93\u5165adb shell dumpsys activity [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[261],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/4959"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4959"}],"version-history":[{"count":9,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/4959\/revisions"}],"predecessor-version":[{"id":5010,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/4959\/revisions\/5010"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4959"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}