{"id":102198,"date":"2026-09-08T10:49:22","date_gmt":"2026-09-08T02:49:22","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/102198.html"},"modified":"2026-09-08T10:49:22","modified_gmt":"2026-09-08T02:49:22","slug":"android-%e5%b8%b8%e8%80%83%e9%9d%a2%e8%af%95%e9%a2%98%e8%af%a6%e8%a7%a3%ef%bc%9a%e4%bb%8e%e5%9b%9b%e5%a4%a7%e7%bb%84%e4%bb%b6%e5%88%b0%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%ef%bc%8c%e4%b8%80%e7%af%87","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/102198.html","title":{"rendered":"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908024920-6a9f77b06d316.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u4e00\u3001\u524d\u8a00&#xff1a;Android \u9762\u8bd5\u8003\u4ec0\u4e48&#xff1f;<\/h3>\n<p>Android \u9762\u8bd5\u7684\u7ecf\u5178\u7ed3\u6784\u662f&#xff1a;Java\/Kotlin \u57fa\u7840 \u2192 Android \u56db\u5927\u7ec4\u4ef6 \u2192 \u6d88\u606f\u673a\u5236 \u2192 View \u4f53\u7cfb \u2192 \u6027\u80fd\u4f18\u5316 \u2192 \u9879\u76ee\u6df1\u6316\u3002\u5176\u4e2d Android \u7279\u6709\u7684\u90e8\u5206\u96c6\u4e2d\u5728\u4e2d\u95f4\u4e09\u5757&#xff0c;\u4e5f\u662f\u672c\u6587\u91cd\u70b9\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908024921-6a9f77b12c69d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4ee5\u4e0b 25 \u9053\u9ad8\u9891\u9898\u6309\u6a21\u5757\u6574\u7406&#xff0c;\u6bcf\u9898\u7ed9\u51fa\u6807\u51c6\u7b54\u6848 &#043; \u8ffd\u95ee\u70b9&#xff0c;\u80cc\u719f\u80fd\u8986\u76d6 80% \u7684\u4e00\u4e8c\u9762\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u56db\u5927\u7ec4\u4ef6<\/h3>\n<h4>Q1&#xff1a;Activity \u7684\u751f\u547d\u5468\u671f&#xff1f;\u5f02\u5e38\u60c5\u51b5\u5462&#xff1f;<\/h4>\n<p>\u6807\u51c6\u7b54\u6848&#xff1a;<\/p>\n<p>\u6b63\u5e38\u542f\u52a8&#xff1a;onCreate \u2192 onStart \u2192 onResume<br \/>\n\u9000\u5230\u540e\u53f0&#xff1a;onPause \u2192 onStop<br \/>\n\u56de\u5230\u524d\u53f0&#xff1a;onRestart \u2192 onStart \u2192 onResume<br \/>\n\u9500\u6bc1&#xff1a;    onPause \u2192 onStop \u2192 onDestroy<\/p>\n<p>\u5f02\u5e38\u751f\u547d\u5468\u671f&#xff08;\u6a2a\u7ad6\u5c4f\u5207\u6362&#xff09;&#xff1a;<br \/>\nActivity \u88ab\u9500\u6bc1\u91cd\u5efa&#xff0c;\u8d70 onPause \u2192 onStop \u2192 onSaveInstanceState \u2192 onDestroy \u2192 onCreate \u2192 onStart \u2192 onRestoreInstanceState \u2192 onResume\u3002<\/p>\n<p>\u6570\u636e\u4fdd\u5b58&#xff1a;\u5728 onSaveInstanceState(Bundle) \u91cc\u5b58\u4e34\u65f6\u6570\u636e&#xff0c;onCreate \/ onRestoreInstanceState \u91cc\u6062\u590d\u3002<\/p>\n<p>\u8ffd\u95ee\u70b9&#xff1a;onPause \u91cc\u80fd\u505a\u8017\u65f6\u64cd\u4f5c\u5417&#xff1f;\u2014\u2014\u4e0d\u80fd&#xff0c;\u65b0 Activity \u7684 onResume \u8981\u7b49\u4e0a\u4e00\u4e2a onPause \u6267\u884c\u5b8c&#xff08;\u5e94\u7528\u5c42\u5982\u6b64&#xff09;&#xff0c;\u5361\u8fd9\u91cc\u4f1a\u6389\u5e27\u3002<\/p>\n<h4>Q2&#xff1a;Activity \u7684\u56db\u79cd\u542f\u52a8\u6a21\u5f0f&#xff1f;<\/h4>\n<table>\n<tr>\u6a21\u5f0f\u884c\u4e3a\u5178\u578b\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>standard<\/td>\n<td>\u6bcf\u6b21\u65b0\u5efa\u5b9e\u4f8b\u5165\u6808<\/td>\n<td>\u9ed8\u8ba4<\/td>\n<\/tr>\n<tr>\n<td>singleTop<\/td>\n<td>\u6808\u9876\u5b58\u5728\u5219\u590d\u7528&#xff08;\u8d70 onNewIntent&#xff09;<\/td>\n<td>\u63a8\u9001\u8be6\u60c5\u9875&#xff0c;\u9632\u8fde\u70b9\u5f00 N \u4e2a<\/td>\n<\/tr>\n<tr>\n<td>singleTask<\/td>\n<td>\u6808\u5185\u5b58\u5728\u5219\u6e05\u5176\u4e0a\u6240\u6709 Activity<\/td>\n<td>\u4e3b\u9875<\/td>\n<\/tr>\n<tr>\n<td>singleInstance<\/td>\n<td>\u72ec\u5360\u4e00\u4e2a\u4efb\u52a1\u6808<\/td>\n<td>\u901a\u8bdd\u3001\u6765\u7535\u9875<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8ffd\u95ee\u70b9&#xff1a;singleTask &#043; \u4e0d\u540c\u4efb\u52a1\u6808&#xff08;taskAffinity&#xff09;\u7684\u884c\u4e3a&#xff1b;onNewIntent \u751f\u547d\u5468\u671f\u987a\u5e8f&#xff08;onNewIntent \u2192 onRestart \u2192 onStart \u2192 onResume&#xff09;\u3002<\/p>\n<h4>Q3&#xff1a;Service \u7684 startService \u548c bindService \u533a\u522b&#xff1f;<\/h4>\n<table>\n<tr>\u7ef4\u5ea6startServicebindService<\/tr>\n<tbody>\n<tr>\n<td>\u751f\u547d\u5468\u671f<\/td>\n<td>onCreate \u2192 onStartCommand&#xff0c;\u9700\u4e3b\u52a8 stopSelf\/stopService<\/td>\n<td>onCreate \u2192 onBind \u2192 onUnbind \u2192 onDestroy<\/td>\n<\/tr>\n<tr>\n<td>\u4e0e\u8c03\u7528\u8005\u5173\u7cfb<\/td>\n<td>\u65e0\u5173\u8054&#xff0c;\u8c03\u7528\u8005\u9500\u6bc1 Service \u8fd8\u6d3b\u7740<\/td>\n<td>\u7ed1\u5b9a\u5171\u5b58\u4ea1&#xff0c;\u53ef\u62ff\u5230 IBinder \u901a\u4fe1<\/td>\n<\/tr>\n<tr>\n<td>\u7528\u9014<\/td>\n<td>\u540e\u53f0\u4e0b\u8f7d\u3001\u64ad\u653e<\/td>\n<td>\u4e0e Activity \u4ea4\u4e92&#xff08;\u5982\u97f3\u4e50\u8fdb\u5ea6\u6761&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8ffd\u95ee\u70b9&#xff1a;Android 8.0 \u540e\u53f0 Service \u9650\u5236 \u2192 \u524d\u53f0\u670d\u52a1&#xff08;startForeground &#043; \u901a\u77e5&#xff09;&#xff1b;\u4fdd\u6d3b\u4e3a\u4ec0\u4e48\u9760 Service \u9760\u4e0d\u4f4f\u3002<\/p>\n<h4>Q4&#xff1a;\u5e7f\u64ad\u7684\u6709\u5e8f\u5e7f\u64ad\u548c\u65e0\u5e8f\u5e7f\u64ad&#xff1f;<\/h4>\n<ul>\n<li>\u666e\u901a\u5e7f\u64ad&#xff08;sendBroadcast&#xff09;&#xff1a;\u5f02\u6b65&#xff0c;\u6240\u6709\u63a5\u6536\u8005\u51e0\u4e4e\u540c\u65f6\u6536\u5230&#xff0c;\u4e0d\u53ef\u62e6\u622a\u3002<\/li>\n<li>\u6709\u5e8f\u5e7f\u64ad&#xff08;sendOrderedBroadcast&#xff09;&#xff1a;\u6309\u4f18\u5148\u7ea7\u4f9d\u6b21\u4f20\u9012&#xff0c;\u53ef abortBroadcast() \u622a\u65ad\u3001\u53ef\u4fee\u6539\u7ed3\u679c\u3002<\/li>\n<li>\u672c\u5730\u5e7f\u64ad&#xff08;LocalBroadcastManager&#xff09;&#xff1a;\u4ec5\u5e94\u7528\u5185&#xff0c;\u5b89\u5168\u9ad8\u6548&#xff08;\u5b98\u65b9\u5df2\u5e9f\u5f03&#xff0c;\u63a8\u8350\u7528 EventBus\/Flow \u66ff\u4ee3&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u8ffd\u95ee\u70b9&#xff1a;\u9759\u6001\u6ce8\u518c\u5e7f\u64ad\u5728 Android 8.0 \u540e\u7684\u9650\u5236&#xff08;\u5927\u90e8\u5206\u7cfb\u7edf\u5e7f\u64ad\u53ea\u5141\u8bb8\u52a8\u6001\u6ce8\u518c&#xff09;\u3002<\/p>\n<h4>Q5&#xff1a;ContentProvider \u7684\u4f5c\u7528&#xff1f;<\/h4>\n<p>\u8de8\u8fdb\u7a0b\u6570\u636e\u5171\u4eab\u7684\u6807\u51c6\u65b9\u6848\u3002\u5e95\u5c42\u57fa\u4e8e Binder&#xff0c;\u901a\u8fc7 URI \u5b9a\u4f4d\u6570\u636e&#xff08;content:\/\/com.app.provider\/user\/1&#xff09;\u3002<\/p>\n<p>\u8ffd\u95ee\u70b9&#xff1a;\u4e3a\u4ec0\u4e48\u542f\u52a8 App \u65f6 ContentProvider \u7684 onCreate \u5148\u4e8e Application.onCreate&#xff1f;&#xff08;initOrder \u91cc installContentProviders \u5148\u6267\u884c&#xff09;\u2014\u2014\u9ad8\u9891\u51b7\u95e8\u9898\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u6d88\u606f\u673a\u5236&#xff1a;Handler \u5fc5\u8003\u4e94\u8fde<\/h3>\n<h4>Q6&#xff1a;Handler \u7684\u5b8c\u6574\u5de5\u4f5c\u539f\u7406&#xff1f;<\/h4>\n<p>\u6807\u51c6\u7b54\u6848&#xff08;\u5fc5\u987b\u6309\u94fe\u8def\u80cc&#xff09;&#xff1a;<\/p>\n<p>Handler.sendMessage(msg)<br \/>\n   \u2192 MessageQueue.enqueueMessage(msg, when)   \u6d88\u606f\u5165\u961f&#xff08;\u6309\u65f6\u95f4\u6392\u5e8f&#xff09;<br \/>\n   \u2192 Looper.loop() \u6b7b\u5faa\u73af\u53d6\u6d88\u606f                &#xff08;\u4e3b\u7ebf\u7a0b\u65e9\u6709 Looper&#xff09;<br \/>\n   \u2192 msg.target.dispatchMessage(msg)           \u5206\u53d1\u7ed9 Handler<br \/>\n   \u2192 handleMessage(msg)                        \u5904\u7406<\/p>\n<p>\u89d2\u8272\u5206\u5de5&#xff1a;<\/p>\n<table>\n<tr>\u89d2\u8272\u804c\u8d23\u4e00\u53e5\u8bdd<\/tr>\n<tbody>\n<tr>\n<td>Handler<\/td>\n<td>\u53d1\u9001\u548c\u5904\u7406\u6d88\u606f<\/td>\n<td>\u90ae\u9012\u5458<\/td>\n<\/tr>\n<tr>\n<td>Message<\/td>\n<td>\u6d88\u606f\u8f7d\u4f53&#xff08;\u542b what\/obj\/when\/target&#xff09;<\/td>\n<td>\u4fe1\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>MessageQueue<\/td>\n<td>\u6309\u65f6\u95f4\u6392\u5e8f\u7684\u4f18\u5148\u7ea7\u961f\u5217<\/td>\n<td>\u4fe1\u7bb1<\/td>\n<\/tr>\n<tr>\n<td>Looper<\/td>\n<td>\u6b7b\u5faa\u73af\u53d6\u6d88\u606f&#xff0c;\u9a71\u52a8\u5206\u53d1<\/td>\n<td>\u90ae\u5c40\u5206\u62e3\u5458<\/td>\n<\/tr>\n<tr>\n<td>ThreadLocal<\/td>\n<td>\u6bcf\u4e2a\u7ebf\u7a0b\u5b58\u81ea\u5df1\u7684 Looper<\/td>\n<td>\u5de5\u724c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Q7&#xff1a;\u4e3b\u7ebf\u7a0b\u4e3a\u4ec0\u4e48\u4e0d\u4f1a\u56e0\u4e3a Looper.loop() \u6b7b\u5faa\u73af\u5361\u6b7b&#xff1f;<\/h4>\n<p>\u9ad8\u9891\u96be\u9898\u3002\u7b54\u6848\u5206\u4e09\u5c42&#xff1a;<\/p>\n<li>\u4e3b\u7ebf\u7a0b\u672c\u6765\u5c31\u8be5\u5e38\u9a7b\u2014\u2014\u6b7b\u5faa\u73af\u662f&#034;\u6709\u6d3b\u5e72\u6d3b\u3001\u6ca1\u6d3b\u4f11\u7720&#034;&#xff08;epoll \u673a\u5236&#xff09;&#xff0c;MessageQueue \u7684 next() \u91cc nativePollOnce \u963b\u585e\u65f6\u4e0d\u6d88\u8017 CPU&#xff0c;\u4e0d\u662f\u5fd9\u7b49\u3002<\/li>\n<li>\u5361 ANR \u7684\u662f\u6d88\u606f\u5904\u7406\u6162&#xff0c;\u4e0d\u662f\u5faa\u73af\u672c\u8eab\u2014\u2014ANR \u662f\u67d0\u6761\u6d88\u606f&#xff08;\u5982 input \u4e8b\u4ef6&#xff09;5 \u79d2\u6ca1\u5904\u7406\u5b8c\u3002<\/li>\n<li>\u6574\u4e2a App \u751f\u547d\u5468\u671f\u90fd\u8dd1\u5728\u8fd9\u4e2a\u5faa\u73af\u91cc\u2014\u2014Activity \u7684 onCreate \u90fd\u662f\u88ab\u8fd9\u4e2a\u5faa\u73af\u8c03\u5ea6\u7684\u4e00\u6761\u6d88\u606f\u3002<\/li>\n<h4>Q8&#xff1a;Message.obtain() \u4e3a\u4ec0\u4e48\u8981\u590d\u7528&#xff1f;\u600e\u4e48\u590d\u7528&#xff1f;<\/h4>\n<p>Message \u5185\u90e8\u7ef4\u62a4\u4e00\u4e2a\u94fe\u8868\u6c60&#xff08;sPool&#xff09;&#xff0c;obtain() \u4f18\u5148\u4ece\u6c60\u91cc\u53d6&#xff0c;recycle() \u65f6\u6e05\u7a7a\u6570\u636e\u6302\u56de\u6c60\u5934\u3002\u907f\u514d\u9ad8\u9891\u53d1\u6d88\u606f\u65f6\u5927\u91cf\u521b\u5efa\u5bf9\u8c61\u89e6\u53d1 GC \u6296\u52a8\u3002<\/p>\n<p>\u8ffd\u95ee\u70b9&#xff1a;\u4e3a\u4ec0\u4e48 Message \u6700\u5927\u7f13\u5b58 50 \u4e2a&#xff08;MAX_POOL_SIZE&#xff09;&#xff1b;View \u7684\u6ed1\u52a8\u6d88\u606f\u540c\u7406\u7528 obtain\u3002<\/p>\n<h4>Q9&#xff1a;Handler \u5bfc\u81f4\u5185\u5b58\u6cc4\u6f0f\u7684\u539f\u56e0\u548c\u89e3\u51b3&#xff1f;<\/h4>\n<p>\u539f\u56e0&#xff1a;\u975e\u9759\u6001\u5185\u90e8\u7c7b Handler \u9690\u5f0f\u6301\u6709 Activity&#xff0c;Message \u672a\u5904\u7406\u65f6\u88ab MessageQueue \u6301\u6709 \u2192 Message \u2192 Handler \u2192 Activity&#xff0c;Activity \u9500\u6bc1\u4e86\u5374\u65e0\u6cd5\u56de\u6536\u3002<\/p>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<li>Handler \u58f0\u660e\u4e3a static class &#043; WeakReference&lt;Activity&gt;<\/li>\n<li>onDestroy \u91cc handler.removeCallbacksAndMessages(null)<\/li>\n<h4>Q10&#xff1a;IdleHandler \u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p>MessageQueue \u7a7a\u95f2\u65f6\u7684\u56de\u8c03&#xff08;addIdleHandler&#xff09;\u3002\u7528\u8fc7\u7684\u573a\u666f&#xff1a;\u5ef6\u8fdf\u521d\u59cb\u5316\u975e\u7d27\u6025\u4efb\u52a1&#xff08;\u5982\u65e5\u5fd7\u4e0a\u62a5&#xff09;&#xff0c;\u7b49\u4e3b\u7ebf\u7a0b\u4e0d\u5fd9\u4e86\u518d\u5e72\u3002\u8ffd\u95ee\u70b9&#xff1a;ViewRootImpl \u7684\u9996\u6b21\u7ed8\u5236\u5c31\u4f9d\u8d56 IdleHandler&#xff08;\u7b49\u6d88\u606f\u961f\u5217\u7a7a\u4e86\u518d measure\/layout&#xff09;\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001View \u4f53\u7cfb<\/h3>\n<h4>Q11&#xff1a;View \u7684\u7ed8\u5236\u6d41\u7a0b&#xff1f;<\/h4>\n<p>\u6807\u51c6\u7b54\u6848&#xff1a;<\/p>\n<p>ViewRootImpl.performTraversals()<br \/>\n  \u251c\u2500\u2500 performMeasure()  \u2192 onMeasure()   \u6d4b\u91cf&#xff1a;\u786e\u5b9a View \u5927\u5c0f&#xff08;MeasureSpec&#xff09;<br \/>\n  \u251c\u2500\u2500 performLayout()   \u2192 onLayout()    \u5e03\u5c40&#xff1a;\u786e\u5b9a View \u4f4d\u7f6e<br \/>\n  \u2514\u2500\u2500 performDraw()     \u2192 onDraw()      \u7ed8\u5236&#xff1a;\u753b\u5230\u5c4f\u5e55&#xff08;Canvas&#xff09;<\/p>\n<p>MeasureSpec \u4e09\u79cd\u6a21\u5f0f&#xff1a;<\/p>\n<table>\n<tr>\u6a21\u5f0f\u542b\u4e49\u5bf9\u5e94<\/tr>\n<tbody>\n<tr>\n<td>EXACTLY<\/td>\n<td>\u786e\u5b9a\u5927\u5c0f<\/td>\n<td>match_parent \/ \u56fa\u5b9a dp<\/td>\n<\/tr>\n<tr>\n<td>AT_MOST<\/td>\n<td>\u6700\u5927\u4e0d\u8d85\u8fc7<\/td>\n<td>wrap_content<\/td>\n<\/tr>\n<tr>\n<td>UNSPECIFIED<\/td>\n<td>\u4e0d\u9650\u5236<\/td>\n<td>ScrollView \u5bf9\u5b50 View<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8ffd\u95ee\u70b9&#xff1a;\u81ea\u5b9a\u4e49 View \u65f6 wrap_content \u4e3a\u4ec0\u4e48\u548c match_parent \u4e00\u6837&#xff1f;\u2014\u2014onMeasure \u9ed8\u8ba4\u5b9e\u73b0\u4e0d\u5904\u7406 AT_MOST&#xff0c;\u8981\u81ea\u5df1 setMeasuredDimension\u3002<\/p>\n<h4>Q12&#xff1a;\u4e8b\u4ef6\u5206\u53d1\u673a\u5236&#xff1f;<\/h4>\n<p>\u6807\u51c6\u7b54\u6848&#xff08;\u7ecf\u5178 U \u578b\u56fe&#xff09;&#xff1a;<\/p>\n<p>Activity \u2192 Window \u2192 DecorView \u2192 ViewGroup \u2192 &#8230; \u2192 View<\/p>\n<p>\u4e09\u4e2a\u6838\u5fc3\u65b9\u6cd5&#xff1a;<br \/>\ndispatchTouchEvent()     \u5206\u53d1<br \/>\nonInterceptTouchEvent()  \u62e6\u622a&#xff08;\u4ec5 ViewGroup \u6709&#xff09;<br \/>\nonTouchEvent()           \u6d88\u8d39<\/p>\n<ul>\n<li>\u7236\u62e6\u622a&#xff0c;\u5b50\u6536\u4e0d\u5230&#xff1a;onInterceptTouchEvent \u8fd4\u56de true \u2192 \u5b50 View \u6536 ACTION_DOWN \u4e4b\u540e\u7684\u7cfb\u5217\u4e8b\u4ef6 \u2192 \u4e8b\u4ef6\u4ea4\u7ed9\u7236\u7684 onTouchEvent<\/li>\n<li>\u5b50\u5904\u7406\u4e86&#xff0c;\u7236\u5c31\u4e0d\u5904\u7406&#xff1a;\u5b50 onTouchEvent \u8fd4\u56de true \u6d88\u8d39 \u2192 \u7236\u4e0d\u518d\u6536 MOVE\/UP<\/li>\n<li>\u8bf7\u6c42\u7236\u4e0d\u62e6\u622a&#xff1a;requestDisallowInterceptTouchEvent(true)&#xff08;\u5b50 View \u5728 DOWN \u540e\u8c03\u7528&#xff09;<\/li>\n<li>\u6ed1\u52a8\u51b2\u7a81&#xff1a;\u5916\u90e8\u62e6\u622a\u6cd5&#xff08;\u7236\u6539 onInterceptTouchEvent \u5224\u65ad\u65b9\u5411&#xff09;\/ \u5185\u90e8\u62e6\u622a\u6cd5&#xff08;\u5b50 disallow&#xff09;<\/li>\n<\/ul>\n<h4>Q13&#xff1a;requestLayout \/ invalidate \/ postInvalidate \u533a\u522b&#xff1f;<\/h4>\n<table>\n<tr>\u65b9\u6cd5\u4f5c\u7528\u8303\u56f4\u89e6\u53d1\u7ebf\u7a0b<\/tr>\n<tbody>\n<tr>\n<td>requestLayout<\/td>\n<td>\u4ece\u5f53\u524d\u8282\u70b9\u5411\u4e0a\u5230 ViewRootImpl<\/td>\n<td>measure &#043; layout &#043; draw<\/td>\n<td>\u53ef\u4efb\u610f&#xff08;\u6700\u7ec8\u6392\u5230\u4e3b\u7ebf\u7a0b&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>invalidate<\/td>\n<td>\u53ea\u91cd\u7ed8\u5f53\u524d View<\/td>\n<td>\u53ea draw&#xff08;onDraw&#xff09;<\/td>\n<td>\u5fc5\u987b\u4e3b\u7ebf\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>postInvalidate<\/td>\n<td>\u540c invalidate<\/td>\n<td>\u53ea draw<\/td>\n<td>\u53ef\u5b50\u7ebf\u7a0b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e94\u3001\u6027\u80fd\u4f18\u5316<\/h3>\n<h4>Q14&#xff1a;\u5185\u5b58\u6cc4\u6f0f\u7684\u5e38\u89c1\u573a\u666f\u548c\u6392\u67e5&#xff1f;<\/h4>\n<p>\u9ad8\u9891\u6cc4\u6f0f\u573a\u666f&#xff08;\u80cc 6 \u4e2a&#xff09;&#xff1a;<\/p>\n<li>\u975e\u9759\u6001\u5185\u90e8\u7c7b Handler \/ Thread \/ AsyncTask \u6301\u6709 Activity<\/li>\n<li>\u5355\u4f8b\u6301\u6709 Context&#xff08;\u5e94\u6301 ApplicationContext&#xff09;<\/li>\n<li>\u5e7f\u64ad \/ EventBus \/ \u56de\u8c03\u6ca1\u53cd\u6ce8\u518c<\/li>\n<li>WebView \u672a\u9500\u6bc1&#xff08;\u65b0\u5f00\u8fdb\u7a0b &#043; \u624b\u52a8 onDestroy&#xff09;<\/li>\n<li>\u9759\u6001\u53d8\u91cf\u6301\u6709 View \/ Bitmap<\/li>\n<li>\u533f\u540d\u5185\u90e8\u7c7b&#xff08;\u7f16\u8bd1\u540e\u6301\u6709\u5916\u90e8\u5f15\u7528&#xff09;<\/li>\n<p>\u6392\u67e5\u5de5\u5177&#xff1a;LeakCanary&#xff08;\u5f00\u53d1\u671f\u81ea\u52a8\u6293&#xff09;\u2192 Memory Profiler \u2192 MAT \u5206\u6790 hprof&#xff08;\u770b GC Root \u5f15\u7528\u94fe&#xff09;\u3002<\/p>\n<h4>Q15&#xff1a;\u5361\u987f\u7684\u6392\u67e5\u601d\u8def&#xff1f;<\/h4>\n<p>\u5b9a\u4f4d&#xff1a;Perfetto \/ Systrace \u6293\u5e27 \u2192 \u627e\u6389\u5e27\u7684\u5e27<br \/>\n\u5f52\u56e0&#xff1a;\u770b\u4e3b\u7ebf\u7a0b\u5728\u5e72\u4ec0\u4e48<br \/>\n  \u251c\u2500\u2500 \u4e3b\u7ebf\u7a0b\u505a IO&#xff08;\u8bfb SP \/ \u6570\u636e\u5e93&#xff09;\u2192 \u79fb\u5230\u5b50\u7ebf\u7a0b \/ MMKV<br \/>\n  \u251c\u2500\u2500 \u4e3b\u7ebf\u7a0b\u505a\u590d\u6742\u5e03\u5c40 \u2192 \u964d\u5c42\u7ea7&#xff08;ConstraintLayout \/ merge \/ ViewStub&#xff09;<br \/>\n  \u251c\u2500\u2500 \u8fc7\u5ea6\u7ed8\u5236 \u2192 \u5f00\u53d1\u8005\u9009\u9879\u68c0\u67e5&#xff0c;\u7ea2\u8272\u533a\u57df\u4f18\u5316<br \/>\n  \u2514\u2500\u2500 \u9891\u7e41 GC \u2192 \u5185\u5b58\u6296\u52a8&#xff0c;\u627e\u5faa\u73af\u91cc\u521b\u5efa\u5bf9\u8c61\u7684\u5730\u65b9<\/p>\n<p>\u5173\u952e\u6307\u6807&#xff1a;\u5e27\u8017\u65f6 16ms&#xff08;60Hz&#xff09;\/ 8.3ms&#xff08;120Hz&#xff09;&#xff1b;Vitals \u7684 ANR \u7387 &lt; 0.47%\u3001\u5d29\u6e83\u7387 &lt; 1%\u3002<\/p>\n<h4>Q16&#xff1a;Bitmap \u4f18\u5316\u600e\u4e48\u505a&#xff1f;<\/h4>\n<li>\u91c7\u6837\u538b\u7f29&#xff1a;inSampleSize \u6309\u76ee\u6807\u5c3a\u5bf8\u7b97&#xff08;\u5148 inJustDecodeBounds \u53ea\u8bfb\u5c3a\u5bf8&#xff09;<\/li>\n<li>\u683c\u5f0f&#xff1a;ARGB_8888 \u2192 RGB_565&#xff08;\u65e0\u900f\u660e\u9700\u6c42&#xff0c;\u5185\u5b58\u51cf\u534a&#xff09;<\/li>\n<li>\u786c\u4ef6\u4f4d\u56fe&#xff1a;inPreferredConfig &#061; HARDWARE&#xff0c;\u50cf\u7d20\u5b58 GPU \u663e\u5b58&#xff0c;\u4e0d\u5360 Java \u5806<\/li>\n<li>\u53ca\u65f6\u56de\u6536&#xff1a;Android 8.0 \u540e Bitmap \u50cf\u7d20\u5b58 native \u5806&#xff08;NativeAllocationRegistry \u81ea\u52a8\u56de\u6536&#xff09;&#xff0c;\u8001\u7248\u672c\u624b\u52a8 recycle<\/li>\n<h4>Q17&#xff1a;APK \u5305\u4f53\u79ef\u4f18\u5316&#xff1f;<\/h4>\n<ul>\n<li>\u8d44\u6e90&#xff1a;\u56fe\u7247\u8f6c WebP\u3001\u65e0\u7528\u5728 R8\/\u8d44\u6e90\u6df7\u6dc6&#xff08;AndResGuard&#xff09;\u538b\u7f29\u3001\u6309\u5bc6\u5ea6\u5206\u5305<\/li>\n<li>\u4ee3\u7801&#xff1a;R8 \u6df7\u6dc6\u88c1\u526a&#xff08;minifyEnabled &#043; shrinkResources&#xff09;<\/li>\n<li>so&#xff1a;abiFilters \u53ea\u7559 armeabi-v7a \/ arm64-v8a&#xff0c;\u6216\u6309 ABI \u5206\u5305<\/li>\n<li>\u52a8\u6001\u4ea4\u4ed8&#xff1a;App Bundle&#xff08;Play&#xff09;\u6309\u9700\u4e0b\u8f7d<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516d\u3001Kotlin \/ \u534f\u7a0b \/ \u65b0\u6280\u672f<\/h3>\n<h4>Q18&#xff1a;\u534f\u7a0b\u548c\u7ebf\u7a0b\u7684\u533a\u522b&#xff1f;&#xff08;Android \u573a\u666f&#xff09;<\/h4>\n<p>\u7528\u6237\u6001\u8f7b\u91cf\u7ea7&#034;\u7ebf\u7a0b&#034;&#xff1a;\u6302\u8d77\u4e0d\u963b\u585e\u7ebf\u7a0b\u3001\u521b\u5efa\u6210\u672c\u51e0\u5341\u5b57\u8282\u3001\u7ed3\u6784\u5316\u5e76\u53d1\u9632\u6cc4\u6f0f\u3002Android \u6807\u914d\u7528\u6cd5&#xff1a;<\/p>\n<p>viewModelScope<span class=\"token punctuation\">.<\/span><span class=\"token function\">launch<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">val<\/span> user <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">withContext<\/span><span class=\"token punctuation\">(<\/span>Dispatchers<span class=\"token punctuation\">.<\/span>IO<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> api<span class=\"token punctuation\">.<\/span><span class=\"token function\">fetchUser<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token function\">updateUi<\/span><span class=\"token punctuation\">(<\/span>user<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\">\/\/ \u81ea\u52a8\u56de\u4e3b\u7ebf\u7a0b<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8ffd\u95ee\u70b9&#xff1a;suspend \u539f\u7406&#xff08;\u72b6\u6001\u673a&#xff09;&#xff1b;launch vs async&#xff1b;viewModelScope \u4e3a\u4ec0\u4e48\u5b89\u5168&#xff08;Activity \u65cb\u8f6c\u9500\u6bc1\u81ea\u52a8\u53d6\u6d88&#xff09;\u3002<\/p>\n<h4>Q19&#xff1a;Flow \u548c LiveData \u7684\u533a\u522b&#xff1f;<\/h4>\n<table>\n<tr>\u7ef4\u5ea6LiveDataFlow<\/tr>\n<tbody>\n<tr>\n<td>\u751f\u547d\u5468\u671f\u611f\u77e5<\/td>\n<td>\u2705 \u5185\u7f6e<\/td>\n<td>\u9700 repeatOnLifecycle \u5305\u4e00\u5c42<\/td>\n<\/tr>\n<tr>\n<td>\u64cd\u4f5c\u7b26<\/td>\n<td>\u5c11&#xff08;map\/switchMap&#xff09;<\/td>\n<td>\u4e30\u5bcc&#xff08;debounce\/filter\/combine\u2026&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u6d41\u7c7b\u578b<\/td>\n<td>\u503c\u6301\u6709<\/td>\n<td>\u51b7\u6d41\/\u70ed\u6d41<\/td>\n<\/tr>\n<tr>\n<td>\u8de8\u5c42\u4f7f\u7528<\/td>\n<td>\u4ec5 UI \u5c42<\/td>\n<td>\u6570\u636e\u5c42\/\u9886\u57df\u5c42\u901a\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7ed3\u8bba&#xff1a;\u65b0\u9879\u76ee UI \u72b6\u6001\u7528 StateFlow&#xff0c;\u6570\u636e\u6d41\u5904\u7406\u7528 Flow&#xff0c;LiveData \u53ea\u5728\u8001\u9879\u76ee\u7ef4\u62a4\u3002<\/p>\n<h4>Q20&#xff1a;Jetpack MVVM \u7684\u5b8c\u6574\u6570\u636e\u6d41&#xff1f;<\/h4>\n<p>View&#xff08;Activity\/Fragment&#xff09;<br \/>\n  \u2195 \u89c2\u5bdf StateFlow \/ LiveData<br \/>\nViewModel&#xff08;\u6301\u6709 UI \u72b6\u6001&#xff0c;\u4e0d\u6301 Context&#xff09;<br \/>\n  \u2195 \u8c03\u7528<br \/>\nRepository&#xff08;\u5355\u4e00\u6570\u636e\u6e90\u539f\u5219&#xff09;<br \/>\n  \u2199                    \u2198<br \/>\nRoom&#xff08;\u672c\u5730\u7f13\u5b58&#xff09;      Retrofit&#xff08;\u7f51\u7edc&#xff09;<\/p>\n<p>\u6838\u5fc3\u539f\u5219&#xff1a;\u6570\u636e\u5355\u5411\u6d41\u52a8&#xff08;UDF&#xff09;\u3001\u5355\u4e00\u6570\u636e\u6e90&#xff08;SSOT&#xff09;\u3001ViewModel \u4e0d\u6301\u6709\u4efb\u4f55 Context\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u51b7\u95e8\u4f46\u5e38\u95ee<\/h3>\n<h4>Q21&#xff1a;Android \u7684\u8fdb\u7a0b\u4f18\u5148\u7ea7&#xff1f;<\/h4>\n<p>\u524d\u53f0\u8fdb\u7a0b &gt; \u53ef\u89c1\u8fdb\u7a0b &gt; \u670d\u52a1\u8fdb\u7a0b &gt; \u7f13\u5b58\u8fdb\u7a0b&#xff08;\u540e\u53f0 LRU&#xff09;<\/p>\n<p>\u7cfb\u7edf\u6309\u4f18\u5148\u7ea7\u4ece\u4f4e\u5230\u9ad8\u6740\u5185\u5b58\u3002\u8ffd\u95ee\u70b9&#xff1a;\u4e3a\u4ec0\u4e48\u4fdd\u6d3b\u8d8a\u6765\u8d8a\u96be&#xff08;\u5382\u5546\u767d\u540d\u5355 &#043; Doze \u6a21\u5f0f &#043; App Standby&#xff09;&#xff0c;\u6b63\u8def\u662f\u628a\u8fdb\u7a0b\u505a\u8f7b\u3002<\/p>\n<h4>Q22&#xff1a;Binder \u662f\u4ec0\u4e48&#xff1f;\u4e3a\u4ec0\u4e48\u9009\u5b83\u800c\u4e0d\u662f Socket&#xff1f;<\/h4>\n<p>Android \u8de8\u8fdb\u7a0b\u901a\u4fe1\u7684\u5e95\u5c42\u673a\u5236\u3002\u9009 Binder \u56e0\u4e3a&#xff1a;\u4e00\u6b21\u62f7\u8d1d&#xff08;mmap \u5185\u5b58\u6620\u5c04&#xff0c;Socket\/\u7ba1\u9053\u8981\u4e24\u6b21&#xff09;\u3001C\/S \u67b6\u6784\u6613\u7528\u3001\u8fdb\u7a0b ID \u6821\u9a8c\u5b89\u5168\u6027\u597d\u3002<\/p>\n<p>\u8ffd\u95ee\u70b9&#xff1a;AIDL \u662f Binder \u7684\u5c01\u88c5&#xff1b;\u56db\u5927\u7ec4\u4ef6\u7684\u8de8\u8fdb\u7a0b\u5168\u9760 Binder\u3002<\/p>\n<h4>Q23&#xff1a;SP&#xff08;SharedPreferences&#xff09;\u4e3a\u4ec0\u4e48\u6162&#xff1f;\u66ff\u4ee3\u54c1&#xff1f;<\/h4>\n<p>SP \u9996\u6b21\u52a0\u8f7d\u540c\u6b65\u8bfb\u6587\u4ef6 &#043; \u5168\u91cf\u89e3\u6790 XML \u5230\u5185\u5b58&#xff08;\u4e3b\u7ebf\u7a0b wait&#xff09;&#xff0c;\u5199\u5165 commit \u540c\u6b65\u3001apply \u867d\u5f02\u6b65\u4f46 QueuedWork \u53ef\u80fd\u963b\u585e\u3002<\/p>\n<p>\u66ff\u4ee3&#xff1a;MMKV&#xff08;mmap &#043; protobuf&#xff0c;\u817e\u8baf&#xff09;\u3001DataStore&#xff08;Kotlin Flow&#xff0c;\u5b98\u65b9\u63a8\u8350&#xff09;\u3002<\/p>\n<h4>Q24&#xff1a;View.post \u4e3a\u4ec0\u4e48\u80fd\u62ff\u5230 View \u5bbd\u9ad8&#xff1f;<\/h4>\n<p>post \u7684 Runnable \u6392\u8fdb\u6d88\u606f\u961f\u5217&#xff0c;\u6267\u884c\u65f6\u673a\u5728 ViewRootImpl \u7684 performTraversals&#xff08;\u7ed8\u5236&#xff09;\u4e4b\u540e\u2014\u2014View \u6d4b\u91cf\u5b8c\u4e86\u81ea\u7136\u6709\u5bbd\u9ad8\u3002<\/p>\n<h4>Q25&#xff1a;\u4e3a\u4ec0\u4e48 onActivityCreated \u88ab\u5e9f\u5f03\u4e86&#xff1f;Fragment \u901a\u4fe1\u600e\u4e48\u505a&#xff1f;<\/h4>\n<p>\u5e9f\u5f03\u662f\u63a8\u52a8\u7528 viewLifecycleOwner \u89c2\u5bdf\u6570\u636e\u3002\u73b0\u4ee3\u901a\u4fe1\u65b9\u5f0f&#xff1a;ViewModel \u5171\u4eab&#xff08;\u540c\u4e00 FragmentManager scope&#xff09;&gt; \u63a5\u53e3\u56de\u8c03 &gt; Result API\u3002<\/p>\n<hr \/>\n<h3>\u516b\u3001\u603b\u7ed3&#xff1a;\u9762\u8bd5\u590d\u4e60\u8def\u7ebf<\/h3>\n<p>\u7b2c\u4e00\u68af\u961f&#xff08;\u5fc5\u80cc&#xff09;&#xff1a;\u751f\u547d\u5468\u671f \/ \u542f\u52a8\u6a21\u5f0f \/ Handler \u4e94\u8fde \/ \u4e8b\u4ef6\u5206\u53d1 \/ \u7ed8\u5236\u6d41\u7a0b<br \/>\n\u7b2c\u4e8c\u68af\u961f&#xff08;\u52a0\u5206&#xff09;&#xff1a;\u6027\u80fd\u4f18\u5316\u5b9e\u6218\u6848\u4f8b \/ Binder \/ \u534f\u7a0b Flow \/ MVVM \u6570\u636e\u6d41<br \/>\n\u7b2c\u4e09\u68af\u961f&#xff08;\u4eae\u70b9&#xff09;&#xff1a;\u51b7\u542f\u52a8\u4f18\u5316 \/ \u5305\u4f53\u79ef \/ \u7ebf\u4e0a\u76d1\u63a7&#xff08;APM&#xff09;\/ \u8de8\u8fdb\u7a0b\u65b9\u6848\u9009\u578b<\/p>\n<p>\u6700\u91cd\u8981\u7684\u4e00\u6761\u5efa\u8bae&#xff1a;\u80cc\u5b8c\u6807\u51c6\u7b54\u6848\u540e&#xff0c;\u4e00\u5b9a\u8981\u51c6\u5907\u4e00\u4e2a\u81ea\u5df1\u9879\u76ee\u91cc\u7684\u771f\u5b9e\u6848\u4f8b\u3002\u6bd4\u5982&#034;\u6211\u4eec App \u542f\u52a8 3s \u2192 1.2s&#034;\u7684\u4f18\u5316\u8fc7\u7a0b&#xff0c;\u6bd4 25 \u9053\u516b\u80a1\u66f4\u80fd\u8ba9\u9762\u8bd5\u5b98\u8bb0\u4f4f\u4f60\u2014\u2014\u516b\u80a1\u7b5b\u4eba&#xff0c;\u6848\u4f8b\u5b9a\u85aa\u3002<\/p>\n<hr \/>\n<h3>\u53c2\u8003\u8d44\u6599<\/h3>\n<ul>\n<li>\u300aAndroid \u5f00\u53d1\u827a\u672f\u63a2\u7d22\u300b\u4efb\u7389\u521a&#xff08;\u56db\u5927\u7ec4\u4ef6 &#043; View \u4f53\u7cfb&#xff09;<\/li>\n<li>\u300aAndroid \u8fdb\u9636\u89e3\u5bc6\u300b\u5218\u671b\u8212&#xff08;\u6d88\u606f\u673a\u5236 &#043; Binder&#xff09;<\/li>\n<li>Google \u5b98\u65b9\u6587\u6863&#xff1a;developer.android.com&#xff08;Jetpack \/ \u6027\u80fd&#xff09;<\/li>\n<li>Android \u6027\u80fd\u4f18\u5316\u5b98\u65b9\u8bfe&#xff1a;Measuring &amp; Improving App Performance<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u524d\u8a00&#xff1a;Android \u9762\u8bd5\u8003\u4ec0\u4e48&#xff1f;<br \/>\nAndroid \u9762\u8bd5\u7684\u7ecf\u5178\u7ed3\u6784\u662f&#xff1a;Java\/Kotlin \u57fa\u7840 \u2192 Android \u56db\u5927\u7ec4\u4ef6 \u2192 \u6d88\u606f\u673a\u5236 \u2192 View \u4f53\u7cfb \u2192 \u6027\u80fd\u4f18\u5316 \u2192 \u9879\u76ee\u6df1\u6316\u3002\u5176\u4e2d Android \u7279\u6709\u7684\u90e8\u5206\u96c6\u4e2d\u5728\u4e2d\u95f4\u4e09\u5757&#xff0c;\u4e5f\u662f\u672c\u6587\u91cd\u70b9\u3002\u4ee5\u4e0b 25 \u9053\u9ad8\u9891\u9898\u6309\u6a21\u5757\u6574\u7406&#xff0c;\u6bcf\u9898\u7ed9\u51fa\u6807\u51c6\u7b54\u6848  \u8ffd\u95ee\u70b9&#xff0c;\u80cc\u719f\u80fd\u8986\u76d6 80% \u7684\u4e00\u4e8c\u9762\u3002\u4e8c\u3001\u56db\u5927\u7ec4\u4ef6<br \/>\nQ1&#xff1a;Activit<\/p>\n","protected":false},"author":2,"featured_media":102196,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[84,56],"topic":[],"class_list":["post-102198","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-android","tag-56"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f - \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\/102198.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u524d\u8a00&#xff1a;Android \u9762\u8bd5\u8003\u4ec0\u4e48&#xff1f; Android \u9762\u8bd5\u7684\u7ecf\u5178\u7ed3\u6784\u662f&#xff1a;Java\/Kotlin \u57fa\u7840 \u2192 Android \u56db\u5927\u7ec4\u4ef6 \u2192 \u6d88\u606f\u673a\u5236 \u2192 View \u4f53\u7cfb \u2192 \u6027\u80fd\u4f18\u5316 \u2192 \u9879\u76ee\u6df1\u6316\u3002\u5176\u4e2d Android \u7279\u6709\u7684\u90e8\u5206\u96c6\u4e2d\u5728\u4e2d\u95f4\u4e09\u5757&#xff0c;\u4e5f\u662f\u672c\u6587\u91cd\u70b9\u3002\u4ee5\u4e0b 25 \u9053\u9ad8\u9891\u9898\u6309\u6a21\u5757\u6574\u7406&#xff0c;\u6bcf\u9898\u7ed9\u51fa\u6807\u51c6\u7b54\u6848 \u8ffd\u95ee\u70b9&#xff0c;\u80cc\u719f\u80fd\u8986\u76d6 80% \u7684\u4e00\u4e8c\u9762\u3002\u4e8c\u3001\u56db\u5927\u7ec4\u4ef6 Q1&#xff1a;Activit\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/102198.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-08T02:49:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908024920-6a9f77b06d316.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\/102198.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/102198.html\",\"name\":\"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-08T02:49:22+00:00\",\"dateModified\":\"2026-09-08T02:49:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/102198.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/102198.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102198.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f\"}]},{\"@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":"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f - \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\/102198.html","og_locale":"zh_CN","og_type":"article","og_title":"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u524d\u8a00&#xff1a;Android \u9762\u8bd5\u8003\u4ec0\u4e48&#xff1f; Android \u9762\u8bd5\u7684\u7ecf\u5178\u7ed3\u6784\u662f&#xff1a;Java\/Kotlin \u57fa\u7840 \u2192 Android \u56db\u5927\u7ec4\u4ef6 \u2192 \u6d88\u606f\u673a\u5236 \u2192 View \u4f53\u7cfb \u2192 \u6027\u80fd\u4f18\u5316 \u2192 \u9879\u76ee\u6df1\u6316\u3002\u5176\u4e2d Android \u7279\u6709\u7684\u90e8\u5206\u96c6\u4e2d\u5728\u4e2d\u95f4\u4e09\u5757&#xff0c;\u4e5f\u662f\u672c\u6587\u91cd\u70b9\u3002\u4ee5\u4e0b 25 \u9053\u9ad8\u9891\u9898\u6309\u6a21\u5757\u6574\u7406&#xff0c;\u6bcf\u9898\u7ed9\u51fa\u6807\u51c6\u7b54\u6848 \u8ffd\u95ee\u70b9&#xff0c;\u80cc\u719f\u80fd\u8986\u76d6 80% \u7684\u4e00\u4e8c\u9762\u3002\u4e8c\u3001\u56db\u5927\u7ec4\u4ef6 Q1&#xff1a;Activit","og_url":"https:\/\/www.wsisp.com\/helps\/102198.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-08T02:49:22+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908024920-6a9f77b06d316.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\/102198.html","url":"https:\/\/www.wsisp.com\/helps\/102198.html","name":"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-08T02:49:22+00:00","dateModified":"2026-09-08T02:49:22+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/102198.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/102198.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/102198.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Android \u5e38\u8003\u9762\u8bd5\u9898\u8be6\u89e3\uff1a\u4ece\u56db\u5927\u7ec4\u4ef6\u5230\u6027\u80fd\u4f18\u5316\uff0c\u4e00\u7bc7\u5403\u900f"}]},{"@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\/102198","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=102198"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102198\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/102196"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=102198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=102198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=102198"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=102198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}