{"id":58124,"date":"2025-08-16T02:49:48","date_gmt":"2025-08-15T18:49:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/58124.html"},"modified":"2025-08-16T02:49:48","modified_gmt":"2025-08-15T18:49:48","slug":"%e7%bd%91%e7%bb%9c%e8%b5%84%e6%ba%90%e6%a8%a1%e6%9d%bf-%e5%9f%ba%e4%ba%8eandroid-studio-%e5%ae%9e%e7%8e%b0%e7%9a%84%e5%a4%96%e5%8d%96%e8%ae%a2%e9%a4%90app","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/58124.html","title":{"rendered":"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f--\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83%E8%AF%B4%E6%98%8E-toc\" style=\"margin-left:0px\">\u4e00\u3001\u6d4b\u8bd5\u73af\u5883\u8bf4\u660e<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E9%A1%B9%E7%9B%AE%E7%AE%80%E4%BB%8B-toc\" style=\"margin-left:0px\">\u4e8c\u3001\u9879\u76ee\u7b80\u4ecb<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E9%A1%B9%E7%9B%AE%E6%BC%94%E7%A4%BA-toc\" style=\"margin-left:0px\">\u4e09\u3001\u9879\u76ee\u6f14\u793a<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E9%83%A8%E8%AE%BE%E8%AE%A1%E8%AF%A6%E6%83%85%EF%BC%88%E9%83%A8%E5%88%86)-toc\" style=\"margin-left:0px\">\u56db\u3001\u90e8\u8bbe\u8ba1\u8be6\u60c5&#xff08;\u90e8\u5206)<\/p>\n<p id=\"%E5%95%86%E5%AE%B6%E9%A6%96%E9%A1%B5-toc\" style=\"margin-left:40px\">\u5546\u5bb6\u9996\u9875<\/p>\n<p id=\"%E7%94%A8%E6%88%B7%E9%A6%96%E9%A1%B5-toc\" style=\"margin-left:40px\">\u7528\u6237\u9996\u9875<\/p>\n<p style=\"margin-left:40px\">\n<p id=\"%E4%BA%94%E3%80%81%E9%A1%B9%E7%9B%AE%E6%BA%90%E7%A0%81%C2%A0-toc\" style=\"margin-left:0px\"><span style=\"color:#fe2c24\">\u4e94\u3001\u9879\u76ee\u6e90\u7801\u00a0<\/span><\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E4%B8%80%E3%80%81%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83%E8%AF%B4%E6%98%8E\">\u4e00\u3001\u6d4b\u8bd5\u73af\u5883\u8bf4\u660e<\/h2>\n<p>\u7535\u8111\u73af\u5883<\/p>\n<p>Windows 11<\/p>\n<p>\u7f16\u5199\u8bed\u8a00<\/p>\n<p>JAVA<\/p>\n<p>\u5f00\u53d1\u8f6f\u4ef6<\/p>\n<p>Android Studio \u00a0(2020)<\/p>\n<p>\u5f00\u53d1\u8f6f\u4ef6\u53ea\u8981\u5927\u4e8e\u7b49\u4e8e\u6d4b\u8bd5\u7248\u672c\u5373\u53ef(\u8fd1\u51e0\u5e74\u5b98\u7f51\u76f4\u63a5\u4e0b\u8f7d\u4e5f\u53ef\u4ee5)&#xff0c;\u82e5\u662f\u7248\u672c\u4f4e\u4e8e\u6d4b\u8bd5\u7248\u672c\u8bf7\u81ea\u884c\u6d4b\u8bd5\u3002\u9879\u76ee\u9700\u8981\u6839\u636e\u4f60\u7684\u8f6f\u4ef6\u81ea\u884c\u9002\u914d<\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81%E9%A1%B9%E7%9B%AE%E7%AE%80%E4%BB%8B\">\u4e8c\u3001\u9879\u76ee\u7b80\u4ecb<\/h2>\n<p>\u8be5\u9879\u76ee\u7b80\u4ecb\u6765\u81ea\u7f51\u7edc&#xff0c;\u5177\u4f53\u5185\u5bb9\u9700\u8981\u81ea\u884c\u6d4b\u8bd5<\/p>\n<p>\u672c\u7cfb\u7edf\u57fa\u4e8e Android \u5e73\u53f0\u5f00\u53d1&#xff0c;\u91c7\u7528 Java\u8bed\u8a00\u7f16\u5199\u3002\u91c7\u7528 MVC\u6a21\u5f0f\u8fdb\u884c\u8bbe\u8ba1&#xff0c;\u5c06\u4e1a\u52a1\u903b\u8f91\u3001\u6570\u636e\u8bbf\u95ee\u548c\u754c\u9762\u663e\u793a\u5206\u79bb&#xff0c;\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u53ef\u91cd\u7528\u6027\u3002<\/p>\n<p>\u6570\u636e\u5e93\u91c7\u7528 SQLite&#xff0c;\u652f\u6301\u8f7b\u91cc\u7ea7\u6570\u636e\u5b58\u50a8\u548c\u5feb\u901f\u67e5\u8be2\u3002\u540c\u65f6&#xff0c;\u4f7f\u7528 HTTP \u534f\u8bae\u8fdb\u884c\u7f51\u7edc\u901a\u4fe1,\u5b9e\u73b0\u6570\u636e\u7684\u8fdc\u7a0b\u8bbf\u95ee\u548c\u540c\u6b65\u3002<\/p>\n<p>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d&#xff0c;\u6211\u4eec\u91c7\u7528\u4e86Android studio \u4f5c\u4e3a\u5f00\u53d1\u5de5\u5177&#xff0c;\u4f7f\u7528\u4e86 Grade\u6784\u5efa\u5de5\u5177\u8fdb\u884c\u9879\u76ee\u6784\u5efa\u548c\u4f9d\u8d56\u7ba1\u7406\u3002\u672c\u7cfb\u7edf\u662f\u4e00\u4e2a\u7efc\u5408\u6027\u7684Android \u7ba1\u7406\u7cfb\u7edf&#xff0c;\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u529f\u80fd\u6a21\u5757:<\/p>\n<p>\u8d26\u53f7\u7ba1\u7406:\u7cfb\u7edf\u652f\u6301\u5206\u6743\u7ba1\u7406&#xff0c;\u4e0d\u540c\u8d26\u53f7\u62e5\u6709\u4e0d\u540c\u7684\u6743\u9650\u3002\u7ba1\u7406\u5458\u62e5\u6709\u6700\u9ad8\u6743\u9650&#xff0c;\u53ef\u4ee5\u8fdb\u884c\u6743\u9650\u5206\u914d\u7b49\u64cd\u4f5c\u3002\u8d26\u53f7\u5bc6\u7801\u91c7\u7528\u52a0\u5bc6\u7b97\u6cd5\u8fdb\u884c\u5b89\u5168\u5b58\u50a8&#xff0c;\u786e\u4fdd\u7528\u6237\u6570\u636e\u7684\u5b89\u5168\u6027\u3002\u540c\u65f6&#xff0c;\u7cfb\u7edf\u652f\u6301\u591a\u8bed\u8a00\u5207\u6362&#xff0c;\u6ee1\u8db3\u4e0d\u540c\u56fd\u5bb6\u548c\u5730\u533a\u7528\u6237\u7684\u9700\u6c42\u3002<\/p>\n<p>\u5546\u5bb6\u7ba1\u7406:\u5546\u5bb6\u53ef\u4ee5\u8fdb\u884c\u5e97\u94fa\u5546\u54c1\u7684\u589e\u5220\u6539\u67e5\u64cd\u4f5c&#xff0c;\u540c\u65f6\u53ef\u4ee5\u53d1\u5e03\u65b0\u7684\u5546\u54c1\u4fe1\u606f\u3002\u5546\u54c1\u4fe1\u606f\u5305\u62ec\u540d\u79f0\u3001\u63cf\u8ff0\u3001\u4ef7\u683c\u3001\u56fe\u7247\u7b49&#xff0c;\u5546\u5bb6\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u6dfb\u52a0\u6216\u4fee\u6539\u5546\u54c1\u4fe1\u606f\u3002\u6b64\u5916&#xff0c;\u5546\u5bb6\u8fd8\u53ef\u4ee5\u4fee\u6539\u5bc6\u7801\u548c\u4e2a\u4eba\u4fe1\u606f&#xff0c;\u63d0\u9ad8\u8d26\u53f7\u7684\u5b89\u5168\u6027&#xff0c;\u7528\u6237\u7ba1\u7406:\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u7cfb\u7edf\u4e3b\u518c\u5546\u5bb6\u6216\u7528\u6237\u8d26\u53f7&#xff0c;\u5e76\u8bbe\u7f6e\u5bc6\u7801\u3002\u7528\u6237\u53ef\u4ee5\u67e5\u770b\u672a\u5904\u7406\u8ba2\u5355\u3001\u5df2\u5b8c\u6210\u8ba2\u5355\u7b49&#xff0c;\u5e76\u6839\u636e\u8ba2\u5355\u72b6\u6001\u548c\u65f6\u95f4\u7b5b\u9009\u548c\u67e5\u770b\u8ba2\u5355\u4fe1\u606f\u3002\u7528\u6237\u8fd8\u53ef\u4ee5\u67e5\u770b\u5546\u5bb6\u8bc4\u8bba&#xff0c;\u4fee\u6539\u4e2a\u4eba\u4fe1\u606f\u548c\u5bc6\u7801&#xff0c;\u4ee5\u53ca\u589e\u6539\u67e5\u6536\u8d27\u5730\u5740\u7b49\u3002<\/p>\n<p>\u8ba2\u5355\u7ba1\u7406:\u672c\u7cfb\u7edf\u652f\u6301\u4e70\u5bb6\u548c\u5356\u5bb6\u8fdb\u884c\u8ba2\u5355\u64cd\u4f5c&#xff0c;\u5305\u62ec\u67e5\u770b\u672a\u5904\u7406\u8ba2\u5355\u3001\u5df2\u5b8c\u6210\u8ba2\u5355\u3001\u53d6\u6d88\u8ba2\u5355\u548c\u5b8c\u6210\u8ba2\u5355\u7b49\u3002\u7528\u6237\u53ef\u4ee5\u6839\u636e\u8ba2\u5355\u72b6\u6001\u548c\u65f6\u95f4\u7b5b\u9009\u548c\u67e5\u770b\u8ba2\u5355\u4fe1\u606f&#xff0c;\u540c\u65f6\u53ef\u4ee5\u67e5\u770b\u8ba2\u5355\u8be6\u60c5\u548c\u64cd\u4f5c\u8ba2\u5355\u72b6\u6001\u3002\u6b64\u5916&#xff0c;\u7cfb\u7edf\u8fd8\u652f\u6301\u8ba2\u5355\u5bfc\u51fa\u548c\u6253\u5370\u529f\u80fd&#xff0c;\u65b9\u4fbf\u7528\u6237\u7ba1\u7406\u548c\u8ddf\u8e2a\u8ba2\u5355\u3002<\/p>\n<p>\u8bc4\u8bba\u7ba1\u7406:\u7528\u6237\u53ef\u4ee5\u5bf9\u8d2d\u4e70\u7684\u5546\u54c1\u8fdb\u884c\u8bc4\u4ef7&#xff0c;\u4e3a\u5176\u4ed6\u7528\u6237\u63d0\u4f9b\u53c2\u8003\u3002\u8bc4\u8bba\u5185\u5bb9\u5305\u62ec\u8bc4\u5206\u3001\u6587\u5b57\u8bc4\u4ef7\u548c\u56fe\u7247\u8bc4\u4ef7\u7b49&#xff0c;\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u4fee\u6539\u6216\u5220\u9664\u8bc4\u8bba\u3002\u540c\u65f6&#xff0c;\u7cfb\u7edf\u8fd8\u652f\u6301\u533f\u540d\u8bc4\u4ef7\u529f\u80fd&#xff0c;\u4fdd\u62a4\u7528\u6237\u7684\u9690\u79c1\u548c\u6743\u76ca\u3002<\/p>\n<p>\u6536\u8d27\u5730\u5740\u7ba1\u7406:\u7528\u6237\u53ef\u4ee5\u6dfb\u52a0\u3001\u5220\u9664\u6216\u4fee\u6539\u6536\u8d27\u5730\u5740&#xff0c;\u65b9\u4fbf\u7528\u6237\u5728\u8d2d\u4e70\u5546\u54c1\u65f6\u9009\u62e9\u4e0d\u540c\u7684\u6536\u8d27\u5730\u5740\u3002\u7cfb\u7edf\u652f\u6301\u5b58\u50a8\u591a\u4e2a\u6536\u8d27\u5730\u5740&#xff0c;\u63d0\u9ad8\u7528\u6237\u7684\u8d2d\u7269\u4f53\u9a8c\u3002<\/p>\n<h2 id=\"%E4%B8%89%E3%80%81%E9%A1%B9%E7%9B%AE%E6%BC%94%E7%A4%BA\">\u4e09\u3001\u9879\u76ee\u6f14\u793a<\/h2>\n<p>\u7f51\u7edc\u8d44\u6e90\u6a21\u677f&#8211;\u57fa\u4e8eAndroid studio \u5916\u5356\u8ba2\u9910App<\/p>\n<h2 id=\"%E5%9B%9B%E3%80%81%E9%83%A8%E8%AE%BE%E8%AE%A1%E8%AF%A6%E6%83%85%EF%BC%88%E9%83%A8%E5%88%86)\">\u56db\u3001\u90e8\u8bbe\u8ba1\u8be6\u60c5&#xff08;\u90e8\u5206)<\/h2>\n<h3 id=\"%E5%95%86%E5%AE%B6%E9%A6%96%E9%A1%B5\">\u5546\u5bb6\u9996\u9875<\/h3>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"608\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184945-689f8149a52c0.png\" width=\"1080\" \/><\/p>\n<p>1. \u9875\u9762\u7ed3\u6784\u5206\u6790<\/p>\n<p>\u8be5\u9875\u9762\u91c7\u7528\u7ecf\u5178\u7684\u9876\u90e8\u641c\u7d22\u680f&#043;\u4e2d\u90e8\u5185\u5bb9\u533a&#043;\u5e95\u90e8\u5bfc\u822a\u680f\u7684\u4e09\u6bb5\u5f0f\u5e03\u5c40\u7ed3\u6784\u3002<\/p>\n<p>\u9876\u90e8\u662f\u84dd\u8272\u80cc\u666f\u7684\u641c\u7d22\u6846&#xff0c;\u4e2d\u90e8\u4e3a\u5546\u54c1\u5217\u8868\u5c55\u793a\u533a&#xff08;\u4f7f\u7528ListView\u5b9e\u73b0&#xff09;&#xff0c;\u5e95\u90e8\u662f\u5305\u542b&#034;\u9996\u9875&#034;\u3001&#034;\u6dfb\u52a0\u5546\u54c1&#034;\u548c&#034;\u6211\u7684&#034;\u4e09\u4e2a\u9009\u9879\u7684RadioButton\u5bfc\u822a\u680f\u3002<\/p>\n<p>\u6574\u4f53\u91c7\u7528RelativeLayout\u4f5c\u4e3a\u6839\u5e03\u5c40&#xff0c;\u901a\u8fc7\u76f8\u5bf9\u5b9a\u4f4d\u63a7\u5236\u5404\u7ec4\u4ef6\u7684\u4f4d\u7f6e\u5173\u7cfb&#xff0c;\u5982\u641c\u7d22\u680f\u4e0e\u5185\u5bb9\u533a\u7684\u4e0a\u4e0b\u8854\u63a5&#xff0c;\u4ee5\u53ca\u5bfc\u822a\u680f\u56fa\u5b9a\u5728\u5c4f\u5e55\u5e95\u90e8\u3002<\/p>\n<p>\u8fd9\u79cd\u7ed3\u6784\u6e05\u6670\u5730\u533a\u5206\u4e86\u529f\u80fd\u6a21\u5757&#xff0c;\u7b26\u5408\u5e38\u89c1\u7684\u79fb\u52a8\u5e94\u7528\u8bbe\u8ba1\u89c4\u8303\u3002<\/p>\n<p>2. \u6838\u5fc3\u6280\u672f\u5e94\u7528<\/p>\n<p>\u9875\u9762\u8fd0\u7528\u4e86\u591a\u9879Android\u6838\u5fc3\u6280\u672f&#xff1a;\u901a\u8fc7SP\u5b9e\u73b0\u672c\u5730\u6570\u636e\u5b58\u50a8&#xff0c;\u7528\u4e8e\u83b7\u53d6\u5f53\u524d\u767b\u5f55\u8d26\u53f7&#xff1b;\u4f7f\u7528\u81ea\u5b9a\u4e49BaseAdapter&#xff08;FoodAdapter&#xff09;\u5b9e\u73b0ListView\u7684\u6570\u636e\u7ed1\u5b9a&#xff1b;\u91c7\u7528TextWatcher\u76d1\u542c\u5668\u5b9e\u73b0\u5b9e\u65f6\u641c\u7d22\u529f\u80fd&#xff1b;<\/p>\n<p>\u901a\u8fc7\u4e0a\u4e0b\u6587\u83dc\u5355&#xff08;ContextMenu&#xff09;\u5b9e\u73b0\u5546\u54c1\u6761\u76ee\u7684\u957f\u6309\u64cd\u4f5c&#xff1b;\u5229\u7528Intent\u5b9e\u73b0\u9875\u9762\u8df3\u8f6c\u548c\u6570\u636e\u4f20\u9012\u3002<\/p>\n<p>\u7279\u522b\u662f\u901a\u8fc7RadioButton\u6a21\u62df\u5e95\u90e8\u5bfc\u822a\u680f\u6548\u679c&#xff0c;\u5b9e\u73b0\u56fe\u6587\u6df7\u6392&#xff0c;\u5e76\u901a\u8fc7\u81ea\u5b9a\u4e49ButtonColorListener\u63a7\u5236\u6309\u94ae\u72b6\u6001\u5207\u6362&#xff0c;\u5c55\u73b0\u4e86\u826f\u597d\u7684\u4ea4\u4e92\u8bbe\u8ba1\u3002<\/p>\n<p>3. \u529f\u80fd\u8be6\u7ec6\u8bf4\u660e<\/p>\n<p>\u8be5\u9875\u9762\u662f\u5546\u5bb6\u7aef\u4e3b\u754c\u9762&#xff0c;\u4e3b\u8981\u5b9e\u73b0\u4e09\u5927\u529f\u80fd&#xff1a;\u9876\u90e8\u641c\u7d22\u6846\u53ef\u5b9e\u65f6\u7b5b\u9009\u5546\u54c1&#xff1b;\u4e2d\u90e8\u5217\u8868\u5c55\u793a\u5546\u5bb6\u6240\u6709\u5546\u54c1&#xff0c;\u652f\u6301\u957f\u6309\u5f39\u51fa\u83dc\u5355\u8fdb\u884c\u5220\u9664\u6216\u4fee\u6539\u64cd\u4f5c&#xff1b;\u5e95\u90e8\u5bfc\u822a\u53ef\u5207\u6362\u81f3\u5546\u54c1\u6dfb\u52a0\u9875\u9762\u6216\u4e2a\u4eba\u4e2d\u5fc3\u3002<\/p>\n<p>\u641c\u7d22\u529f\u80fd\u901a\u8fc7\u76d1\u542c\u8f93\u5165\u5185\u5bb9\u52a8\u6001\u67e5\u8be2\u6570\u636e\u5e93\u5e76\u5237\u65b0\u5217\u8868&#xff0c;\u5546\u54c1\u7ba1\u7406\u529f\u80fd\u901a\u8fc7\u6570\u636e\u5e93\u64cd\u4f5c\u5b9e\u73b0\u6301\u4e45\u5316\u5b58\u50a8\u3002\u6574\u4f53\u91c7\u7528\u4e8b\u4ef6\u9a71\u52a8\u67b6\u6784&#xff0c;\u5404\u9879\u64cd\u4f5c\u90fd\u914d\u6709\u76f8\u5e94\u7684\u7528\u6237\u53cd\u9988&#xff08;\u5982\u5220\u9664\u6210\u529f\u7684Toast\u63d0\u793a&#xff09;&#xff0c;\u4f53\u73b0\u4e86\u5b8c\u6574\u7684\u4e1a\u52a1\u903b\u8f91\u95ed\u73af\u548c\u7528\u6237\u4f53\u9a8c\u8bbe\u8ba1\u3002<\/p>\n<p>package com.example.orderfood.activity;<\/p>\n<p>import android.annotation.SuppressLint;<br \/>\nimport android.content.Context;<br \/>\nimport android.content.Intent;<br \/>\nimport android.content.SharedPreferences;<br \/>\nimport android.os.Bundle;<br \/>\nimport android.text.Editable;<br \/>\nimport android.text.TextWatcher;<br \/>\nimport android.view.ContextMenu;<br \/>\nimport android.view.MenuItem;<br \/>\nimport android.view.View;<br \/>\nimport android.widget.AdapterView;<br \/>\nimport android.widget.Button;<br \/>\nimport android.widget.EditText;<br \/>\nimport android.widget.ListView;<br \/>\nimport android.widget.Toast;<\/p>\n<p>import androidx.annotation.NonNull;<br \/>\nimport androidx.appcompat.app.AppCompatActivity;<\/p>\n<p>import com.example.orderfood.R;<br \/>\nimport com.example.orderfood.adapter.FoodAdapter;<br \/>\nimport com.example.orderfood.bean.FoodBean;<br \/>\nimport com.example.orderfood.dao.FoodDao;<br \/>\nimport com.example.orderfood.dao.UserDao;<br \/>\nimport com.example.orderfood.listener.ButtonColorListener;<\/p>\n<p>import java.util.ArrayList;<\/p>\n<p>public class BusinessActivity extends AppCompatActivity {<\/p>\n<p>    ArrayList&lt;FoodBean&gt; originalItems;<br \/>\n    ListView foodList;<\/p>\n<p>    FoodAdapter adapter;<\/p>\n<p>    &#064;Override<br \/>\n    protected void onCreate(Bundle savedInstanceState) {<br \/>\n        super.onCreate(savedInstanceState);<br \/>\n        setContentView(R.layout.activity_business);<\/p>\n<p>        \/\/\u5b9e\u73b0\u52a0\u8f7d\u98df\u7269\u5217\u8868<br \/>\n        foodList &#061; this.findViewById(R.id.business_list_view);\/\/\u521b\u5efa\u4e00\u4e2a\u89c6\u56fe<\/p>\n<p>        \/\/\u83b7\u53d6\u5f53\u524d\u8d26\u53f7,\u8fdb\u884c\u67e5\u8be2<br \/>\n        SharedPreferences sharedPreferences &#061; getSharedPreferences(&#034;data&#034;, Context.MODE_PRIVATE);<br \/>\n        String account &#061; sharedPreferences.getString(&#034;account&#034;, &#034;&#034;);<\/p>\n<p>        originalItems &#061; UserDao.getAllFood(account);\/\/\u67e5\u627e\u5230\u6240\u6709\u6570\u636e<\/p>\n<p>        if (originalItems &#061;&#061; null || originalItems.size() &#061;&#061; 0) {<br \/>\n            foodList.setAdapter(null);<br \/>\n        } else {<br \/>\n            adapter &#061; new FoodAdapter(this, originalItems);<br \/>\n            foodList.setAdapter(adapter);<br \/>\n        }<\/p>\n<p>        \/\/\u5b9e\u73b0\u70b9\u51fb\u6309\u94ae\u7684\u65f6\u5019\u8bbe\u7f6e\u4e00\u4e0b\u9009\u4e2d\u7684\u989c\u8272<br \/>\n        Button home &#061; findViewById(R.id.business_home);<br \/>\n        Button add &#061; findViewById(R.id.business_add);<br \/>\n        Button my &#061; findViewById(R.id.business_my);<\/p>\n<p>        home.setOnClickListener(new ButtonColorListener(home, add, my, 1));<br \/>\n        add.setOnClickListener(new ButtonColorListener(home, add, my, 1));<br \/>\n        my.setOnClickListener(new ButtonColorListener(home, add, my, 1));<br \/>\n        home.callOnClick();\/\/\u6a21\u62df\u70b9\u51fbhome<\/p>\n<p>        \/\/\u70b9\u51fb\u52a0\u53f7\u8fdb\u884c\u8df3\u8f6c\u754c\u9762<br \/>\n        add.setOnClickListener(new View.OnClickListener() {<br \/>\n            &#064;Override<br \/>\n            public void onClick(View view) {<br \/>\n                Intent intent &#061; new Intent(BusinessActivity.this, AddGoodActivity.class);<br \/>\n                startActivity(intent);<\/p>\n<p>            }<br \/>\n        });<\/p>\n<p>        my.setOnClickListener(new View.OnClickListener() {<br \/>\n            &#064;Override<br \/>\n            public void onClick(View view) {<\/p>\n<p>                Intent intent &#061; new Intent(BusinessActivity.this, BusinessMyActivity.class);<br \/>\n                overridePendingTransition(0, 0);<br \/>\n                startActivity(intent);<\/p>\n<p>            }<br \/>\n        });<\/p>\n<p>        EditText search &#061; findViewById(R.id.business_search);\/\/\u8fd9\u4e2a\u662f\u641c\u7d22\u7684\u5185\u5bb9<br \/>\n        search.addTextChangedListener(new TextWatcher() {<br \/>\n            &#064;Override<br \/>\n            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {<\/p>\n<p>            }<\/p>\n<p>            &#064;Override<br \/>\n            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {<\/p>\n<p>            }<\/p>\n<p>            &#064;Override<br \/>\n            public void afterTextChanged(Editable editable) {<br \/>\n                \/\/\u6267\u884c\u641c\u7d22<br \/>\n                String name &#061; search.getText().toString();<\/p>\n<p>                originalItems &#061; UserDao.getAllFoodByName(account, name);\/\/\u67e5\u627e\u5230\u6240\u6709\u6570\u636e<\/p>\n<p>                if (originalItems &#061;&#061; null || originalItems.size() &#061;&#061; 0) {<br \/>\n                    foodList.setAdapter(null);<br \/>\n                } else {<br \/>\n                    adapter &#061; new FoodAdapter(BusinessActivity.this, originalItems);<br \/>\n                    foodList.setAdapter(adapter);<br \/>\n                }<br \/>\n            }<br \/>\n        });<\/p>\n<p>        \/\/\u5b9e\u73b0\u6ce8\u518c\u4e0a\u4e0b\u6587<br \/>\n        registerForContextMenu(foodList);<br \/>\n        \/\/\u5b9e\u73b0\u4e0a\u4e0b\u6587\u83dc\u5355&#xff0c;\u5b9e\u73b0\u5220\u9664\u7684\u529f\u80fd<br \/>\n        foodList.setOnLongClickListener(new View.OnLongClickListener() {<br \/>\n            &#064;Override<br \/>\n            public boolean onLongClick(View view) {<br \/>\n                openContextMenu(view);<br \/>\n                return true;<br \/>\n            }<br \/>\n        });<\/p>\n<p>    }<\/p>\n<p>    \/\/ onCreateContextMenu<\/p>\n<p>    &#064;Override<br \/>\n    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {<\/p>\n<p>        super.onCreateContextMenu(menu, v, menuInfo);<br \/>\n        \/\/\u8bbe\u7f6e\u8981\u5f39\u51fa\u7684\u83dc\u5355\u5185\u5bb9<\/p>\n<p>        \/\/ \u8bbe\u7f6e\u5f39\u51fa\u83dc\u5355\u7684\u6807\u9898\u548c\u9009\u9879<br \/>\n        getMenuInflater().inflate(R.menu.business_home_menu, menu);<br \/>\n    }<\/p>\n<p>    \/\/\u8bbe\u7f6e\u70b9\u51fb\u7684\u4e8b\u4ef6\u5185\u5bb9<\/p>\n<p>    &#064;SuppressLint(&#034;NonConstantResourceId&#034;)<br \/>\n    &#064;Override<br \/>\n    public boolean onContextItemSelected(&#064;NonNull MenuItem item) {<\/p>\n<p>        \/\/\u83b7\u53d6\u5230\u83dc\u5355\u7684\u4e0a\u4e0b\u6587\u5185\u5bb9<br \/>\n        AdapterView.AdapterContextMenuInfo info &#061; (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();<br \/>\n        \/\/\u83b7\u53d6\u70b9\u51fb\u5230\u5185\u5bb9\u662f\u4ec0\u4e48<br \/>\n        int position &#061; info.position;<\/p>\n<p>        if (item.getItemId() &#061;&#061; R.id.business_home_list_menu_delete) {<br \/>\n            deleteItem(position);<br \/>\n            return true;<br \/>\n        } else if (item.getItemId() &#061;&#061; R.id.business_home_list_menu_update) {<br \/>\n            updateItem(position);<br \/>\n            return true;<br \/>\n        } else {<br \/>\n            return super.onContextItemSelected(item);<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>    \/**<br \/>\n     * \u5220\u9664\u529f\u80fd<br \/>\n     *<br \/>\n     * &#064;param position<br \/>\n     *\/<br \/>\n    private void deleteItem(int position) {<\/p>\n<p>        \/\/\u6267\u884c\u5220\u9664\u7684\u7b2c\u4e00\u90e8&#xff0c;\u8981\u4ece\u754c\u9762\u4e0a\u9762\u5220\u6389\u5185\u5bb9&#xff0c;\u540c\u65f6\u8fd8\u8981\u4e1b\u6570\u636e\u5e93\u5185\u5bb9\u7684\u65b9\u9762\u5220\u6389\u5185\u5bb9<br \/>\n        \/\/ \u4ece\u6570\u636e\u6e90\u4e2d\u5220\u9664\u9879<br \/>\n        \/\/\u5b9e\u73b0\u5728\u6570\u636e\u5e93\u5c42\u9762\u4e0a\u8fdb\u884c\u5220\u9664\u529f\u80fd<br \/>\n        FoodBean temp &#061; adapter.getItem(position);<br \/>\n        int a &#061; FoodDao.delFood(temp.getS_food_id());<br \/>\n        if (a &#061;&#061; 1) {<br \/>\n            Toast.makeText(this, &#034;\u5220\u9664\u6210\u529f&#034;, Toast.LENGTH_SHORT).show();<br \/>\n            adapter.remove(adapter.getItem(position));<br \/>\n            \/\/ \u901a\u77e5\u9002\u914d\u5668\u6570\u636e\u5df2\u66f4\u6539<br \/>\n            adapter.notifyDataSetChanged();<br \/>\n        } else {<br \/>\n            Toast.makeText(this, &#034;\u5220\u9664\u5931\u8d25&#034;, Toast.LENGTH_SHORT).show();<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>    \/**<br \/>\n     * \u8fd9\u4e2a\u662f\u66f4\u6539\u9879\u76ee<br \/>\n     *<br \/>\n     * &#064;param position<br \/>\n     *\/<\/p>\n<p>    private void updateItem(int position) {<\/p>\n<p>        \/\/\u6267\u884c\u5220\u9664\u7684\u7b2c\u4e00\u90e8&#xff0c;\u8981\u4ece\u754c\u9762\u4e0a\u9762\u5220\u6389\u5185\u5bb9&#xff0c;\u540c\u65f6\u8fd8\u8981\u4e1b\u6570\u636e\u5e93\u5185\u5bb9\u7684\u65b9\u9762\u5220\u6389\u5185\u5bb9<br \/>\n        \/\/ \u4ece\u6570\u636e\u6e90\u4e2d\u5220\u9664\u9879<br \/>\n        \/\/\u5b9e\u73b0\u5728\u6570\u636e\u5e93\u5c42\u9762\u4e0a\u8fdb\u884c\u5220\u9664\u529f\u80fd<br \/>\n        FoodBean temp &#061; adapter.getItem(position);<br \/>\n        \/\/\u9700\u8981\u5c06ID\u4f20\u8fc7\u53bb<br \/>\n        Intent intent &#061; new Intent(BusinessActivity.this, UpdateGoodActivity.class);<br \/>\n        intent.putExtra(&#034;id&#034;, temp.getS_food_id());<br \/>\n        startActivity(intent);<\/p>\n<p>        \/\/\u6253\u5f00\u66f4\u6539\u754c\u9762&#xff0c;\u5e76\u4e14\u7ed8\u5236\u66f4\u6539\u754c\u9762<\/p>\n<p>\/\/        int a&#061;  FoodDao.delFood(temp.getS_food_id());<br \/>\n\/\/        if(a&#061;&#061;1){<br \/>\n\/\/            Toast.makeText(this, &#034;\u5220\u9664\u6210\u529f&#034;, Toast.LENGTH_SHORT).show();<br \/>\n\/\/            adapter.remove(adapter.getItem(position));<br \/>\n\/\/            \/\/ \u901a\u77e5\u9002\u914d\u5668\u6570\u636e\u5df2\u66f4\u6539<br \/>\n\/\/            adapter.notifyDataSetChanged();<br \/>\n\/\/        }else{<br \/>\n\/\/            Toast.makeText(this, &#034;\u5220\u9664\u5931\u8d25&#034;, Toast.LENGTH_SHORT).show();<br \/>\n\/\/        }<\/p>\n<p>    }<\/p>\n<p>} <\/p>\n<h3 id=\"%E7%94%A8%E6%88%B7%E9%A6%96%E9%A1%B5\">\u7528\u6237\u9996\u9875<\/h3>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"608\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184946-689f814a89364.png\" width=\"1080\" \/><\/p>\n<p>1. \u9875\u9762\u7ed3\u6784\u5206\u6790<\/p>\n<p>\u8be5\u9875\u9762\u91c7\u7528\u5355Activity\u591aFragment\u67b6\u6784&#xff0c;\u6574\u4f53\u4e3a\u5782\u76f4\u65b9\u5411\u7684LinearLayout&#xff0c;\u5305\u542b\u4e00\u4e2a\u5360\u636e\u4e3b\u8981\u7a7a\u95f4\u7684Fragment\u5bb9\u5668&#xff08;FrameLayout&#xff09;\u548c\u5e95\u90e8\u7684Material Design\u98ce\u683c\u5bfc\u822a\u680f&#xff08;BottomNavigationView&#xff09;\u3002<\/p>\n<p>\u9875\u9762\u901a\u8fc7\u52a8\u6001\u52a0\u8f7d\u4e0d\u540cFragment\u5b9e\u73b0\u529f\u80fd\u5207\u6362&#xff0c;\u7ed3\u6784\u7b80\u6d01\u9ad8\u6548\u3002\u9876\u90e8\u65e0\u5de5\u5177\u680f\u8bbe\u8ba1\u4f7f\u5185\u5bb9\u533a\u57df\u6700\u5927\u5316&#xff0c;\u84dd\u8272\u8c03\u7684\u5e95\u90e8\u5bfc\u822a\u680f\u63d0\u4f9b\u6e05\u6670\u7684\u89c6\u89c9\u5f15\u5bfc&#xff0c;\u7b26\u5408\u73b0\u4ee3\u79fb\u52a8\u5e94\u7528\u8bbe\u8ba1\u8d8b\u52bf\u3002<\/p>\n<p>Fragment\u5bb9\u5668\u4f7f\u7528\u6743\u91cd\u5e03\u5c40&#xff08;layout_weight&#xff09;\u786e\u4fdd\u5728\u4e0d\u540c\u5c4f\u5e55\u5c3a\u5bf8\u4e0b\u90fd\u80fd\u5408\u7406\u5206\u914d\u7a7a\u95f4&#xff0c;\u4f53\u73b0\u54cd\u5e94\u5f0f\u8bbe\u8ba1\u601d\u60f3\u3002<\/p>\n<p>2. \u6838\u5fc3\u6280\u672f\u5e94\u7528<\/p>\n<p>\u9875\u9762\u6838\u5fc3\u91c7\u7528AndroidX\u7684FragmentManager\u8fdb\u884c\u52a8\u6001Fragment\u7ba1\u7406&#xff0c;\u901a\u8fc7Transaction\u5b9e\u73b0\u754c\u9762\u5207\u6362\u3002<\/p>\n<p>\u5e95\u90e8\u5bfc\u822a\u4f7f\u7528Material Components\u5e93\u7684BottomNavigationView&#xff0c;\u914d\u5408\u81ea\u5b9a\u4e49\u989c\u8272\u9009\u62e9\u5668\u5b9e\u73b0\u56fe\u6807\u548c\u6587\u5b57\u7684\u72b6\u6001\u53d8\u5316\u3002<\/p>\n<p>\u5229\u7528Intent\u53c2\u6570\u4f20\u9012\u5b9e\u73b0\u5dee\u5f02\u5316\u521d\u59cb\u5316&#xff08;\u5982\u76f4\u63a5\u8df3\u8f6c&#034;\u6211\u7684&#034;\u9875\u9762&#xff09;\u3002Fragment\u4e8b\u52a1\u4f7f\u7528commitNow()\u786e\u4fdd\u7acb\u5373\u6267\u884c&#xff0c;\u907f\u514d\u5f02\u6b65\u5e26\u6765\u7684\u72b6\u6001\u4e0d\u4e00\u81f4\u95ee\u9898\u3002<\/p>\n<p>\u6574\u4f53\u67b6\u6784\u4f53\u73b0\u4e86\u5355\u4e00Activity\u539f\u5219\u548c\u6a21\u5757\u5316\u8bbe\u8ba1\u601d\u60f3&#xff0c;\u4fbf\u4e8e\u529f\u80fd\u6269\u5c55\u548c\u7ef4\u62a4\u3002<\/p>\n<p>3. \u529f\u80fd\u8be6\u7ec6\u8bf4\u660e<\/p>\n<p>\u8fd9\u662f\u7528\u6237\u7aef\u4e3b\u63a7\u9875\u9762&#xff0c;\u63d0\u4f9b\u4e09\u5927\u529f\u80fd\u6a21\u5757\u5207\u6362&#xff1a;\u9996\u9875\u5c55\u793a\u672a\u5b8c\u6210\u8ba2\u5355\u548c\u4e2a\u4eba\u4e2d\u5fc3\u3002<\/p>\n<p>\u7279\u6b8a\u573a\u666f\u652f\u6301\u901a\u8fc7Intent\u53c2\u6570\u76f4\u63a5\u5b9a\u4f4d\u5230\u6307\u5b9a\u6a21\u5757&#xff08;\u5982\u4ece\u767b\u5f55\u8df3\u8f6c\u65f6\u76f4\u8fbe\u4e2a\u4eba\u4e2d\u5fc3&#xff09;\u3002<\/p>\n<p>\u5e95\u90e8\u5bfc\u822a\u680f\u91c7\u7528Material Design\u89c4\u8303&#xff0c;\u9009\u4e2d\u72b6\u6001\u6709\u89c6\u89c9\u53cd\u9988&#xff0c;\u64cd\u4f5c\u6d41\u7545\u3002\u9875\u9762\u8fd8\u9884\u7559\u4e86exit()\u65b9\u6cd5\u7528\u4e8e\u5b89\u5168\u9000\u51fa\u5e94\u7528&#xff0c;\u901a\u8fc7finishAffinity()\u786e\u4fdd\u5b8c\u5168\u5173\u95ed\u6240\u6709\u76f8\u5173Activity\u3002<\/p>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u65e2\u4fdd\u8bc1\u4e86\u7528\u6237\u4f53\u9a8c\u7684\u4e00\u81f4\u6027&#xff0c;\u53c8\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u573a\u666f\u9002\u914d\u80fd\u529b\u3002<\/p>\n<p>&lt;?xml version&#061;&#034;1.0&#034; encoding&#061;&#034;utf-8&#034;?&gt;<br \/>\n&lt;LinearLayout xmlns:android&#061;&#034;http:\/\/schemas.android.com\/apk\/res\/android&#034;<br \/>\n    xmlns:app&#061;&#034;http:\/\/schemas.android.com\/apk\/res-auto&#034;<br \/>\n    xmlns:tools&#061;&#034;http:\/\/schemas.android.com\/tools&#034;<br \/>\n    android:layout_width&#061;&#034;match_parent&#034;<br \/>\n    android:layout_height&#061;&#034;match_parent&#034;<br \/>\n    tools:context&#061;&#034;.user.activity.UserManageActivity&#034;<br \/>\n    android:orientation&#061;&#034;vertical&#034;<br \/>\n    android:background&#061;&#034;#F5F5F5&#034;<br \/>\n    &gt;<\/p>\n<p>    &lt;!&#8211;\u591a\u5c42\u7ea7\u53ef\u4ee5\u4e8b\u9879 A&#8211;&gt;<br \/>\n    &lt;FrameLayout<br \/>\n        android:id&#061;&#034;&#064;&#043;id\/fragment_container&#034;<br \/>\n        android:layout_width&#061;&#034;match_parent&#034;<br \/>\n        android:layout_height&#061;&#034;0dp&#034;<br \/>\n        android:layout_weight&#061;&#034;1&#034;<br \/>\n        &gt;<\/p>\n<p>    &lt;\/FrameLayout&gt;<\/p>\n<p>    &lt;com.google.android.material.bottomnavigation.BottomNavigationView<br \/>\n        android:id&#061;&#034;&#064;&#043;id\/bottom_view&#034;<br \/>\n        android:layout_width&#061;&#034;match_parent&#034;<br \/>\n        android:layout_height&#061;&#034;wrap_content&#034;<br \/>\n        android:background&#061;&#034;#03A9F4&#034;<br \/>\n        app:menu&#061;&#034;&#064;menu\/bottom_navigation_menu&#034;<br \/>\n        app:itemIconTint&#061;&#034;&#064;color\/selectcolor&#034;<br \/>\n        app:itemTextColor&#061;&#034;&#064;color\/selectcolor&#034;<br \/>\n        \/&gt;<\/p>\n<p>&lt;\/LinearLayout&gt;<\/p>\n<h2 id=\"%E4%BA%94%E3%80%81%E9%A1%B9%E7%9B%AE%E6%BA%90%E7%A0%81%C2%A0\">\u4e94\u3001\u9879\u76ee\u6e90\u7801\u00a0<\/h2>\n<p style=\"text-align:center\"><span style=\"color:#fe2c24\">&#x1f447;&#x1f447;&#x1f447;&#x1f447;&#x1f447;\u5feb\u6377\u65b9\u5f0f&#x1f447;&#x1f447;&#x1f447;&#x1f447;&#x1f447;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb225\u6b21\u3002\u672c\u9879\u76ee\u662f\u4e00\u4e2a\u57fa\u4e8eAndroid\u5e73\u53f0\u7684\u7efc\u5408\u6027\u7ba1\u7406\u7cfb\u7edf\uff0c\u91c7\u7528Java\u8bed\u8a00\u5f00\u53d1\uff0c\u4f7f\u7528Android Studio\u4f5c\u4e3a\u5f00\u53d1\u5de5\u5177\u3002\u7cfb\u7edf\u91c7\u7528MVC\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u6570\u636e\u5e93\u4f7f\u7528SQLite\uff0c\u652f\u6301\u8f7b\u91cf\u7ea7\u6570\u636e\u5b58\u50a8\u548cHTTP\u7f51\u7edc\u901a\u4fe1\u3002\u4e3b\u8981\u529f\u80fd\u6a21\u5757\u5305\u62ec\uff1a\u8d26\u53f7\u7ba1\u7406\uff08\u652f\u6301\u5206\u6743\u4e0e\u591a\u8bed\u8a00\uff09\u3001\u5546\u5bb6\u7ba1\u7406\uff08\u5546\u54c1\u589e\u5220\u6539\u67e5\uff09\u3001\u7528\u6237\u7ba1\u7406\uff08\u8ba2\u5355\u67e5\u770b\u4e0e\u4e2a\u4eba\u4fe1\u606f\u7ef4\u62a4\uff09\u3001\u8ba2\u5355\u7ba1\u7406\uff08\u72b6\u6001\u8ddf\u8e2a\u4e0e\u5bfc\u51fa\uff09\u3001\u8bc4\u8bba\u7ba1\u7406\uff08\u8bc4\u5206\u4e0e\u533f\u540d\u8bc4\u4ef7\uff09\u4ee5\u53ca\u6536\u8d27\u5730\u5740\u7ba1\u7406\u3002\u5546\u5bb6\u7aef\u91c7\u7528\u9876\u90e8\u641c\u7d22+\u5546\u54c1\u5217\u8868+\u5e95\u90e8\u5bfc\u822a\u7684\u4e09\u6bb5\u5f0f\u5e03\u5c40\uff0c\u5b9e\u73b0\u4e86\u5b9e\u65f6\u641c\u7d22\u3001\u5546\u54c1\u7ba1\u7406\u7b49\u529f\u80fd\uff1b\u7528\u6237\u7aef\u91c7\u7528\u5355Activity\u591aFragm<\/p>\n","protected":false},"author":2,"featured_media":58122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[84,1220,6112,6116,6115,6113,6114],"topic":[],"class_list":["post-58124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-android","tag-android-studio","tag-android-","tag-6116","tag-app","tag-6113","tag-6114"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7f51\u7edc\u8d44\u6e90\u6a21\u677f-\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/58124.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f-\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb225\u6b21\u3002\u672c\u9879\u76ee\u662f\u4e00\u4e2a\u57fa\u4e8eAndroid\u5e73\u53f0\u7684\u7efc\u5408\u6027\u7ba1\u7406\u7cfb\u7edf\uff0c\u91c7\u7528Java\u8bed\u8a00\u5f00\u53d1\uff0c\u4f7f\u7528Android Studio\u4f5c\u4e3a\u5f00\u53d1\u5de5\u5177\u3002\u7cfb\u7edf\u91c7\u7528MVC\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u6570\u636e\u5e93\u4f7f\u7528SQLite\uff0c\u652f\u6301\u8f7b\u91cf\u7ea7\u6570\u636e\u5b58\u50a8\u548cHTTP\u7f51\u7edc\u901a\u4fe1\u3002\u4e3b\u8981\u529f\u80fd\u6a21\u5757\u5305\u62ec\uff1a\u8d26\u53f7\u7ba1\u7406\uff08\u652f\u6301\u5206\u6743\u4e0e\u591a\u8bed\u8a00\uff09\u3001\u5546\u5bb6\u7ba1\u7406\uff08\u5546\u54c1\u589e\u5220\u6539\u67e5\uff09\u3001\u7528\u6237\u7ba1\u7406\uff08\u8ba2\u5355\u67e5\u770b\u4e0e\u4e2a\u4eba\u4fe1\u606f\u7ef4\u62a4\uff09\u3001\u8ba2\u5355\u7ba1\u7406\uff08\u72b6\u6001\u8ddf\u8e2a\u4e0e\u5bfc\u51fa\uff09\u3001\u8bc4\u8bba\u7ba1\u7406\uff08\u8bc4\u5206\u4e0e\u533f\u540d\u8bc4\u4ef7\uff09\u4ee5\u53ca\u6536\u8d27\u5730\u5740\u7ba1\u7406\u3002\u5546\u5bb6\u7aef\u91c7\u7528\u9876\u90e8\u641c\u7d22+\u5546\u54c1\u5217\u8868+\u5e95\u90e8\u5bfc\u822a\u7684\u4e09\u6bb5\u5f0f\u5e03\u5c40\uff0c\u5b9e\u73b0\u4e86\u5b9e\u65f6\u641c\u7d22\u3001\u5546\u54c1\u7ba1\u7406\u7b49\u529f\u80fd\uff1b\u7528\u6237\u7aef\u91c7\u7528\u5355Activity\u591aFragm\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/58124.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-15T18:49:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184945-689f8149a52c0.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58124.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/58124.html\",\"name\":\"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f-\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-15T18:49:48+00:00\",\"dateModified\":\"2025-08-15T18:49:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/58124.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/58124.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58124.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f--\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f-\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/58124.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f-\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb225\u6b21\u3002\u672c\u9879\u76ee\u662f\u4e00\u4e2a\u57fa\u4e8eAndroid\u5e73\u53f0\u7684\u7efc\u5408\u6027\u7ba1\u7406\u7cfb\u7edf\uff0c\u91c7\u7528Java\u8bed\u8a00\u5f00\u53d1\uff0c\u4f7f\u7528Android Studio\u4f5c\u4e3a\u5f00\u53d1\u5de5\u5177\u3002\u7cfb\u7edf\u91c7\u7528MVC\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u6570\u636e\u5e93\u4f7f\u7528SQLite\uff0c\u652f\u6301\u8f7b\u91cf\u7ea7\u6570\u636e\u5b58\u50a8\u548cHTTP\u7f51\u7edc\u901a\u4fe1\u3002\u4e3b\u8981\u529f\u80fd\u6a21\u5757\u5305\u62ec\uff1a\u8d26\u53f7\u7ba1\u7406\uff08\u652f\u6301\u5206\u6743\u4e0e\u591a\u8bed\u8a00\uff09\u3001\u5546\u5bb6\u7ba1\u7406\uff08\u5546\u54c1\u589e\u5220\u6539\u67e5\uff09\u3001\u7528\u6237\u7ba1\u7406\uff08\u8ba2\u5355\u67e5\u770b\u4e0e\u4e2a\u4eba\u4fe1\u606f\u7ef4\u62a4\uff09\u3001\u8ba2\u5355\u7ba1\u7406\uff08\u72b6\u6001\u8ddf\u8e2a\u4e0e\u5bfc\u51fa\uff09\u3001\u8bc4\u8bba\u7ba1\u7406\uff08\u8bc4\u5206\u4e0e\u533f\u540d\u8bc4\u4ef7\uff09\u4ee5\u53ca\u6536\u8d27\u5730\u5740\u7ba1\u7406\u3002\u5546\u5bb6\u7aef\u91c7\u7528\u9876\u90e8\u641c\u7d22+\u5546\u54c1\u5217\u8868+\u5e95\u90e8\u5bfc\u822a\u7684\u4e09\u6bb5\u5f0f\u5e03\u5c40\uff0c\u5b9e\u73b0\u4e86\u5b9e\u65f6\u641c\u7d22\u3001\u5546\u54c1\u7ba1\u7406\u7b49\u529f\u80fd\uff1b\u7528\u6237\u7aef\u91c7\u7528\u5355Activity\u591aFragm","og_url":"https:\/\/www.wsisp.com\/helps\/58124.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T18:49:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184945-689f8149a52c0.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/58124.html","url":"https:\/\/www.wsisp.com\/helps\/58124.html","name":"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f-\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-15T18:49:48+00:00","dateModified":"2025-08-15T18:49:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/58124.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/58124.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/58124.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7f51\u7edc\u8d44\u6e90\u6a21\u677f--\u57fa\u4e8eAndroid Studio \u5b9e\u73b0\u7684\u5916\u5356\u8ba2\u9910App"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=58124"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58124\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/58122"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=58124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=58124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=58124"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=58124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}