{"id":4462,"date":"2023-05-08T17:26:19","date_gmt":"2023-05-08T09:26:19","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=4462"},"modified":"2023-05-08T17:26:19","modified_gmt":"2023-05-08T09:26:19","slug":"%e5%88%9b%e5%bb%ba%e6%a1%8c%e9%9d%a2%e5%bf%ab%e6%8d%b7%e6%96%b9%e5%bc%8fapp%e6%8e%a8%e8%8d%90%e4%bd%bf%e7%94%a8%e4%b8%80%e9%97%a8app","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appkaifa\/4462.html","title":{"rendered":"\u521b\u5efa\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u63a8\u8350\u4f7f\u7528\u4e00\u95e8APP"},"content":{"rendered":"<p>\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u662f\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u8ba9\u7528\u6237\u5feb\u901f\u5730\u8bbf\u95ee\u67d0\u4e2a\u5e94\u7528\u7a0b\u5e8f\u6216\u7f51\u7ad9\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5c06\u4f1a\u4ecb\u7ecd\u5982<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/24\/11\/09990138764.jpg\" \/><\/figure>\n<\/p>\n<p>\u4f55\u521b\u5efa\u4e00\u4e2a\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\uff0c\u5305\u62ec\u5176\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<p>\u539f\u7406<\/p>\n<p>\u5728Android\u7cfb\u7edf\u4e2d\uff0c\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u5728\u684c\u9762\u4e0a\u663e\u793a\u4e00\u4e2a\u56fe\u6807\uff0c\u5f53\u7528\u6237\u70b9\u51fb\u8fd9\u4e2a\u56fe\u6807\u65f6\uff0c\u5b83\u4f1a\u542f\u52a8\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u6216\u6253\u5f00\u4e00\u4e2a\u7f51\u7ad9\u3002\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u7684\u5b9e\u73b0\u539f\u7406\u662f\u901a\u8fc7Intent\u673a\u5236\uff0c\u5c06\u4e00\u4e2aIntent\u53d1\u9001\u7ed9\u7cfb\u7edf\uff0c\u7cfb\u7edf\u4f1a\u6839\u636e\u8fd9\u4e2aIntent\u542f\u52a8\u76f8\u5e94\u7684\u5e94\u7528\u7a0b\u5e8f\u6216\u6253\u5f00\u76f8\u5e94\u7684\u7f51\u7ad9\u3002<\/p>\n<p>\u521b\u5efa\u6b65\u9aa4<\/p>\n<p>\u4e0b\u9762\u662f\u521b\u5efa\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<p>\u6b65\u9aa41\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Android\u9879\u76ee<\/p>\n<p>\u9996\u5148\uff0c\u6253\u5f00Android Studio\uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Android\u9879\u76ee\u3002\u5728\u521b\u5efa\u9879\u76ee\u7684\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u8f93\u5165\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u548c\u5305\u540d\u7b49\u4fe1\u606f\u3002<\/p>\n<p>\u6b65\u9aa42\uff1a\u521b\u5efa\u4e00\u4e2aActivity<\/p>\n<p>\u5728\u65b0\u7684Android\u9879\u76ee\u4e2d\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2aActivity\u6765\u663e\u793a\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u7684\u56fe\u6807\u3002\u5728\u521b\u5efaActivity\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&#8220;`java<\/p>\n<p>public class ShortcutActivity extends AppCompatActivity {<\/p>\n<p>    @Override<\/p>\n<p>    protected void onCreate(Bundle savedInstanceState) {<\/p>\n<p>        super.onCreate(sav<a href=\"https:\/\/www.yimenapp.cn\/fengzhuang-4117.html\">vue \u540e\u53f0\u9879\u76ee\u6253\u5305\u6210\u4e3aapp<\/a>edInstanceState);<\/p>\n<p>        setContentView(R.layout.activity_shortcut);<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u6b65\u9aa43\uff1a\u521b\u5efa\u4e00\u4e2a\u5e03\u5c40\u6587\u4ef6<\/p>\n<p>\u5728\u65b0\u7684Android\u9879\u76ee\u4e2d\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5e03\u5c40\u6587\u4ef6\u6765\u663e\u793a\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u7684\u56fe\u6807\u3002\u5728\u521b\u5efa\u5e03\u5c40\u6587\u4ef6\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&#8220;`xml<\/p>\n<\/p>\n<p>    android:layout_width=&#8221;match_parent&#8221;<\/p>\n<p>    android:layout_height=&#8221;match_parent&#8221;&gt;<\/p>\n<\/p>\n<p>        android:id=&#8221;@+id\/shortcut_icon&#8221;<\/p>\n<p>        android:layout_width=&#8221;wrap_content&#8221;<\/p>\n<p>        android:layout_height=&#8221;wrap_content&#8221;<\/p>\n<p>        android:layout_centerInParent=&#8221;true&#8221;<\/p>\n<p>        android:src=&#8221;@drawable\/ic_shortcut_icon&#8221; \/&gt;<\/p>\n<p><p>&#8220;`<\/p>\n<p>\u6b65\u9aa44\uff1a\u6dfb\u52a0\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f<\/p>\n<p>\u5728\u521b\u5efaActivity\u548c\u5e03\u5c40\u6587\u4ef6\u4e4b\u540e\uff0c\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f\u3002\u5728Android\u7cfb\u7edf\u4e2d\uff0c\u5feb\u6377\u65b9\u5f0f\u662f\u901a\u8fc7Intent\u673a\u5236\u5b9e\u73b0\u7684\u3002\u56e0\u6b64\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2aIntent\u6765\u542f\u52a8\u8fd9\u4e2aActivity\uff0c\u5e76\u5c06\u8fd9\u4e2aIntent\u53d1\u9001\u7ed9\u7cfb\u7edf\uff0c\u8ba9\u7cfb\u7edf\u521b\u5efa\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u521b\u5efa\u5feb\u6377\u65b9\u5f0f\u7684\u4ee3\u7801\uff1a<\/p>\n<p>&#8220;`java<\/p>\n<p>private void addShortcut() {<\/p>\n<p>    Intent shortcutIntent = new Intent(this, ShortcutActivity.class);<\/p>\n<p>    shortcutIntent.setAction(Intent.ACTION_MAIN);<\/p>\n<p>    Intent addIntent = new Intent();<\/p>\n<p>    addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT<a href=\"https:\/\/www.yimenapp.cn\/fengzhuang-3979.html\">app\u5982\u4f55\u505a<\/a>, shortcutIntent);<\/p>\n<p>    addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.shortcut_name));<\/p>\n<p>    addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,<\/p>\n<p>            Intent.ShortcutIconResource.fromContext(this, R.drawable.ic_shortcut_icon));<\/p>\n<p>    addIntent.setAction(&#8220;com.android.launcher.action.INSTALL_SHORTCUT&#8221;);<\/p>\n<p>    sendBroadcast(addIntent);<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u5728\u8fd9\u4e2a\u4ee3\u7801\u4e2d\uff0c\u9996\u5148\u521b\u5efa\u4e86\u4e00\u4e2aIntent\u6765\u542f\u52a8\u8fd9\u4e2aActivity\u3002\u7136\u540e\uff0c\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684Intent\u5e76\u8bbe\u7f6e\u4e86\u4e00\u4e9b\u53c2\u6570\uff0c\u5305\u62ec\u5feb\u6377\u65b9\u5f0f\u7684\u540d\u79f0\u3001\u56fe\u6807\u548cIntent\u7b49\u3002\u6700\u540e\uff0c\u5c06\u8fd9\u4e2aIntent\u53d1\u9001\u7ed9\u7cfb\u7edf\uff0c\u5e76\u4f7f\u7528sendBroadcast()\u65b9\u6cd5\u6765\u53d1\u9001\u5e7f\u64ad\u3002<\/p>\n<p>\u6b65\u9aa45\uff1a\u6d4b\u8bd5\u5feb\u6377\u65b9\u5f0f<\/p>\n<p>\u5728\u6dfb\u52a0\u5feb\u6377\u65b9\u5f0f\u4e4b\u540e\uff0c\u9700\u8981\u6d4b\u8bd5\u8fd9\u4e2a\u5feb\u6377\u65b9\u5f0f\u662f\u5426\u80fd\u591f\u6b63\u5e38\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\u6216\u6253\u5f00\u7f51\u7ad9\u3002\u4e3a\u4e86\u6d4b\u8bd5\u8fd9\u4e2a\u5feb\u6377\u65b9\u5f0f\uff0c\u9700\u8981\u5728\u684c\u9762\u4e0a\u6dfb\u52a0\u8fd9\u4e2a\u5feb\u6377\u65b9\u5f0f\uff0c\u5e76\u70b9\u51fb\u5b83\u6765\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\u6216\u6253\u5f00\u7f51\u7ad9\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u662f\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u8ba9\u7528\u6237\u5feb\u901f\u5730\u8bbf\u95ee\u67d0\u4e2a\u5e94\u7528\u7a0b\u5e8f\u6216\u7f51\u7ad9\u3002\u5728Android\u7cfb\u7edf\u4e2d\uff0c\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u662f\u901a\u8fc7Intent\u673a\u5236\u5b9e\u73b0\u7684\u3002\u521b\u5efa\u4e00\u4e2a\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u7684\u6b65\u9aa4\u5305\u62ec\u521b\u5efa\u4e00\u4e2aActivity\u3001\u521b\u5efa\u4e00\u4e2a\u5e03\u5c40\u6587\u4ef6\u3001\u6dfb\u52a0\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f\u548c\u6d4b\u8bd5\u5feb\u6377\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\u662f\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u8ba9\u7528\u6237\u5feb\u901f\u5730\u8bbf\u95ee\u67d0\u4e2a\u5e94\u7528\u7a0b\u5e8f\u6216\u7f51\u7ad9\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5c06\u4f1a\u4ecb\u7ecd\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u684c\u9762\u5feb\u6377\u65b9\u5f0fapp\uff0c\u5305\u62ec\u5176\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002\u539f\u7406\u5728Android\u7cfb\u7edf\u4e2d\uff0c\u684c\u9762\u5feb\u6377\u65b9\u5f0f<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[5950,3079,1451,1011,2649],"class_list":["post-4462","post","type-post","status-publish","format-standard","hentry","category-appkaifa","tag-vue-web-app","tag-3079","tag-1451","tag-1011","tag-apk"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/4462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=4462"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/4462\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=4462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=4462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=4462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}