{"id":1805,"date":"2025-05-06T00:00:10","date_gmt":"2025-05-05T16:00:10","guid":{"rendered":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/"},"modified":"2025-05-06T00:00:10","modified_gmt":"2025-05-05T16:00:10","slug":"android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/","title":{"rendered":"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3"},"content":{"rendered":"<div class=\"article_content clearfix\" id=\"article_content\">\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/kdoc_html_views-1a98987dfd.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/ck_htmledit_views-704d5b9767.css\" rel=\"stylesheet\"\/>\n<div class=\"markdown_views prism-atom-one-dark\" id=\"content_views\">\n  <svg style=\"display: none;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n   <path d=\"M5,0 0,2.5 5,5z\" id=\"raphael-marker-block\" stroke-linecap=\"round\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\n   <\/path>\n  <\/svg><\/p>\n<p>\n   \u8fd9\u4e24\u5929\u5728\u516c\u4f17\u53f7\u4e0a\u5076\u7136\u770b\u5230\u4e00\u7bc7\u5173\u4e8e\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u7684\u6587\u7ae0\uff0c\u89c9\u5f97\u86ee\u6709\u610f\u601d\u7684\uff0c\u5b66\u4e60\u4e86\u4e00\u4e0b\uff0c\u4ee5\u6b64\u6587\u7ae0\u8bb0\u5f55\u4e00\u4e0b\u600e\u6837\u7ed9\u624b\u673a\u8bbe\u7f6e\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\uff0c\u8bbe\u7f6e\u58c1\u7eb8\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\n  <\/p>\n<h2>\n   <a id=\"_1\"><br \/>\n   <\/a><br \/>\n   \u9759\u6001\u58c1\u7eb8<br \/>\n  <\/h2>\n<p>\n   Android\u4e2d<br \/>\n   <strong><br \/>\n    WallpaperManager<br \/>\n   <\/strong><br \/>\n   \u7cfb\u7edf\u670d\u52a1\u7528\u4e8e\u7ba1\u7406\u58c1\u7eb8\u7684\u8fd0\u884c\u4e0e\u5207\u6362\uff0c\u5e76\u901a\u8fc7WallpaperManager\u7c7b\u5411\u5916\u754c\u63d0\u4f9b\u64cd\u4f5c\u58c1\u7eb8\u7684\u63a5\u53e3\u3002<br \/>\n   <br \/>\n   \u8bbe\u7f6e\u9759\u6001\u58c1\u7eb8\u662f\u901a\u8fc7\u8c03\u7528\u7cfb\u7edf<br \/>\n   <strong><br \/>\n    WallpaperManager<br \/>\n   <\/strong><br \/>\n   \u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u7684\uff0c<br \/>\n   <br \/>\n   \u4e3b\u8981\u5206\u4e3a\u4e0b\u9762\u4e09\u79cd\uff0c\u540c\u4e00\u79cd\u56e0\u4e0d\u540c\u7684\u65b9\u6cd5\u53c2\u6570\u4f1a\u5bf9\u5e94\u591a\u4e2a\u65b9\u6cd5\uff1a<br \/>\n   <br \/>\n   (1)\u901a\u8fc7bitmap\u8bbe\u7f6e\u58c1\u7eb8\uff1a<br \/>\n   <strong><br \/>\n    setBitmap<br \/>\n   <\/strong><br \/>\n   <br \/>\n   (2)\u901a\u8fc7\u8d44\u6e90\u6587\u4ef6\u8bbe\u7f6e\u58c1\u7eb8\uff1a<br \/>\n   <strong><br \/>\n    setResource<br \/>\n   <\/strong><br \/>\n   <br \/>\n   (3)\u901a\u8fc7\u6d41\u8bbe\u7f6e\u58c1\u7eb8\uff1a<br \/>\n   <strong><br \/>\n    setStream<br \/>\n   <\/strong><br \/>\n   <br \/>\n   \u5177\u4f53\u4f8b\u5b50\u5982\u4e0b\uff1a\n  <\/p>\n<pre><code>WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);\n    try {\n      Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);\n      wallpaperManager.setBitmap(bitmap);\n    } catch (IOException e) {\n      e.printStackTrace();\n    }\n<\/code><\/pre>\n<p>\n   <strong><br \/>\n    \u6ce8\u610f<br \/>\n   <\/strong><br \/>\n   \uff1a<br \/>\n   <br \/>\n   (1)\u8bbe\u7f6e\u58c1\u7eb8\u9700\u8981\u58f0\u660e\u6743\u9650\n  <\/p>\n<pre><code>&lt;uses-permission android:name=\"android.permission.SET_WALLPAPER\" \/&gt;\n<\/code><\/pre>\n<p>\n   (2)\u58c1\u7eb8\u5206\u7cfb\u7edf\u58c1\u7eb8\u548c\u9501\u5c4f\u58c1\u7eb8\uff0c\u4f46\u662fAPI 24\u624d\u80fd\u8c03\u7528\u7cfb\u7edfapi\u8bbe\u7f6e\u3002<br \/>\n   <br \/>\n   \u6bd4\u5982\uff1a\n  <\/p>\n<pre><code>WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);\n    try {\n      if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.N){\n        wallpaperManager.setResource(R.raw.wallpaper, WallpaperManager.FLAG_SYSTEM);\n      }\n    } catch (IOException e) {\n      e.printStackTrace();\n    }\n<\/code><\/pre>\n<p>\n   \u5176\u4e2d<br \/>\n   <strong><br \/>\n    WallpaperManager.FLAG_SYSTEM<br \/>\n   <\/strong><br \/>\n   \u8868\u793a\u7cfb\u7edf\u58c1\u7eb8\uff0c<br \/>\n   <strong><br \/>\n    WallpaperManager.FLAG_LOCK<br \/>\n   <\/strong><br \/>\n   \u8868\u793a\u9501\u5c4f\u58c1\u7eb8\u3002<br \/>\n   <br \/>\n   \u65e2\u7136\u53ef\u4ee5\u8bbe\u7f6e\u58c1\u7eb8\uff0c\u76f8\u5bf9\u5e94\u7684\u5c31\u53ef\u4ee5\u6e05\u9664\u58c1\u7eb8\uff0c\u5177\u4f53\u5982\u4e0b\uff1a\n  <\/p>\n<pre><code>WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);\n    try {\n      wallpaperManager.clear();\n    } catch (IOException e) {\n      e.printStackTrace();\n    }\n<\/code><\/pre>\n<h2>\n   <a id=\"_45\"><br \/>\n   <\/a><br \/>\n   \u52a8\u6001\u58c1\u7eb8<br \/>\n  <\/h2>\n<p>\n   \u52a8\u6001\u58c1\u7eb8\u662f\u901a\u8fc7Android\u4e2d\u7684<br \/>\n   <strong><br \/>\n    WallpaperService<br \/>\n   <\/strong><br \/>\n   \u670d\u52a1\u542f\u52a8\u5e76\u5f00\u59cb\u8fdb\u884c\u58c1\u7eb8\u7684\u7ed8\u5236\u5de5\u4f5c,\u5176\u4e2d\u5185\u90e8\u7c7b<br \/>\n   <strong><br \/>\n    Engine<br \/>\n   <\/strong><br \/>\n   \uff0c\u5b9e\u73b0\u4e86\u58c1\u7eb8\u7a97\u53e3\u7684\u521b\u5efa\u4ee5\u53caSurface\u7684\u7ef4\u62a4\u5de5\u4f5c\u3002<br \/>\n   <br \/>\n   \u90a3\u600e\u6837\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u52a8\u6001\u58c1\u7eb8\u5462\uff1f\u4e3b\u8981\u5206\u4e3a\u4ee5\u4e0b\u51e0\u6b65\uff1a<br \/>\n   <br \/>\n   1.\u5b9a\u4e49MyWallpaperService\u7ee7\u627f<br \/>\n   <strong><br \/>\n    WallpaperService<br \/>\n   <\/strong><br \/>\n   \u5e76\u5b9e\u73b0<br \/>\n   <strong><br \/>\n    onCreateEngine<br \/>\n   <\/strong><br \/>\n   \u65b9\u6cd5\uff0c\u8fd4\u56de\u81ea\u5df1\u7684Engine\u5b9e\u73b0\u7c7b\uff1a\n  <\/p>\n<pre><code>public class MyWallpaperService extends WallpaperService {\n  \/\/  \u5b9e\u73b0\u52a8\u6001\u58c1\u7eb8\u5fc5\u987b\u8981\u5b9e\u73b0\u7684\u62bd\u8c61\u65b9\u6cd5\n  @Override\n  public Engine onCreateEngine() {\n    bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.star);\n    return new MyEngine();\n  }\n}\n<\/code><\/pre>\n<p>\n   \u5176\u4e2d\u5728MyEngine\u4e2d\u901a\u8fc7\u5bf9\u751f\u547d\u5468\u671f\u65b9\u6cd5\u7684\u8c03\u7528\u5b9e\u73b0\u58c1\u7eb8\u8fdb\u884c\u52a8\u753b\u548c\u7ed8\u5236\u5de5\u4f5c\uff1a\n  <\/p>\n<pre><code>class MyEngine extends Engine{\n    @Override\n    public void onCreate(SurfaceHolder surfaceHolder) {\n      super.onCreate(surfaceHolder);\n      \u5f53\u5f15\u64ce\u521d\u59cb\u5316\u65f6\u88ab\u8c03\u7528\uff0c\u6b64\u65f6\u7ed8\u5236surface\u8fd8\u672a\u88ab\u521b\u5efa\n      \u53ef\u4ee5\u8fdb\u884cpaint\u7b49\u7684\u521d\u59cb\u5316\u5de5\u4f5c\n    }\n\n    @Override\n    public void onVisibilityChanged(boolean visible) {\n      super.onVisibilityChanged(visible);\n     \u5f53\u58c1\u7eb8\u53ef\u89c1\u6216\u9690\u85cf\u65f6\u88ab\u8c03\u7528\uff0c\u5e94\u8be5\u6682\u505c\u4f60\u7684\u52a8\u753b\uff0c\u4e0d\u518d\u7ed8\u5236\u4efb\u4f55\u4e1c\u897f\uff0c\u4ee5\u8282\u7701CPU(\u6bd4\u5982\u8bf4\u79fb\u9664Runnable\u7b49)\u3002\n    }\n    @Override\n    public void onSurfaceCreated(SurfaceHolder holder) {\n      super.onSurfaceCreated(holder);\n      \u5f53surface\u88ab\u521b\u5efa\u65f6\u88ab\u8c03\u7528\n    }\n\n    @Override\n    public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n      super.onSurfaceChanged(holder, format, width, height);\n      \u5f53surface\u7684\u56fe\u5f62\u7ed3\u6784\u53d1\u751f\u53d8\u5316\uff08\u5927\u5c0f\u3001\u683c\u5f0f\uff09\n    }\n\n    @Override\n    public void onSurfaceDestroyed(SurfaceHolder holder) {\n      super.onSurfaceDestroyed(holder);\n      \u5f53surface\u88ab\u9500\u6bc1\u65f6\u88ab\u8c03\u7528\n    }\n\n    @Override\n    public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep,\n        int xPixelOffset, int yPixelOffset) {\n      super.onOffsetsChanged(xOffset, yOffset, xOffsetStep, yOffsetStep, xPixelOffset,\n          yPixelOffset);\n          \u5f53\u58c1\u7eb8\u53d1\u751f\u504f\u79fb\u53d8\u5316\uff0c\u4f8b\u5982\u7528\u6237\u5de6\u53f3\u6ed1\u52a8\u4e3b\u5c4f\u5e55\uff0c\u8fd9\u4e2a\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u4e00\u4e2a\u5e73\u884c\u6ed1\u52a8\u7684\u6548\u679c\uff0c\u5c31\u662f\u7528\u6237\u6ed1\u52a8\u65f6\uff0c\u58c1\u7eb8\u540c\u65f6\u53d1\u751f\u504f\u79fb\u3002\n    }\n\n    @Override\n    public void onTouchEvent(MotionEvent event) {\n      super.onTouchEvent(event);\n      \u5f53\u663e\u793a\u58c1\u7eb8\u65f6\uff0c\u7528\u6237\u8ddf\u4e3b\u5c4f\u5e55\u6709\u89e6\u6478\u4ea4\u4e92\u65f6\u88ab\u8c03\u7528\n    }\n\n    @Override\n    public void onDestroy() {\n      super.onDestroy();\n      \u5f15\u64ce\u9500\u6bc1\u65f6\u88ab\u8c03\u7528\u3002\u6b64\u65b9\u6cd5\u8c03\u7528\u4e4b\u540e\uff0c\u5f15\u64ce\u53d8\u5f97\u4e0d\u53ef\u7528\u3002\n    }\n  }\n<\/code><\/pre>\n<p>\n   2.\u914d\u7f6eAndroidManifest.xml\uff0c\u58f0\u660e\u4e0a\u8ff0\u4e2d\u7684\u81ea\u5b9a\u4e49\u7684service\u548c\u4e00\u4e2aSettingActivity:\n  <\/p>\n<pre><code>&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n  package=\"com.example.liuwei.wallpagerdemo\"&gt;\n\n  &lt;uses-permission android:name=\"android.permission.SET_WALLPAPER\" \/&gt;\n  &lt;uses-feature\n    android:name=\"android.software.live_wallpaper\"\n    android:required=\"true\"\/&gt;\n\n  &lt;application\n   ......\n    &lt;activity android:name=\".SettingActivity\"\n      android:exported=\"true\"\n      android:label=\"@string\/app_name\"\/&gt;\n  \n    &lt;service android:name=\".MyWallpaperService\"\n      android:enabled=\"true\"\n      android:label=\"@string\/app_name\"\n      android:permission=\"android.permission.BIND_WALLPAPER\"&gt;\n\n      &lt;intent-filter android:priority=\"1\"&gt;\n        &lt;action android:name=\"android.service.wallpaper.WallpaperService\"\/&gt;\n      &lt;\/intent-filter&gt;\n\n      &lt;meta-data\n        android:name=\"android.service.wallpaper\"\n        android:resource=\"@xml\/wallpager\"\/&gt;\n    &lt;\/service&gt;\n  &lt;\/application&gt;\n\n&lt;\/manifest&gt;\n<\/code><\/pre>\n<p>\n   <strong><br \/>\n    \u6ce8\u610f\uff1a<br \/>\n   <\/strong><br \/>\n   <br \/>\n   (1)\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u9700\u8981\u5728MyWallpaperService\u4e2d\u58f0\u660e<br \/>\n   <strong><br \/>\n    android:permission=&#8221;android.permission.BIND_WALLPAPER<br \/>\n   <\/strong><br \/>\n   \u6743\u9650<br \/>\n   <br \/>\n   (2)\u5fc5\u987b\u58f0\u660e\uff0c\u8868\u793a\u52a8\u6001\u58c1\u7eb8\n  <\/p>\n<pre><code>&lt;uses-feature\n    android:name=\"android.software.live_wallpaper\"\n    android:required=\"true\"\/&gt;\n<\/code><\/pre>\n<p>\n   (3)\u58f0\u660eMyWallpaperService\u7684action\u4e3a<br \/>\n   <strong><br \/>\n    android:name=&#8221;android.service.wallpaper.WallpaperService<br \/>\n   <\/strong><br \/>\n   \uff0c\u5176\u4e2d\u5728meta-data\u4e2d\u6709\u4e00\u4e2aresource\u5728\u4e0b\u4e00\u6b65\u4e2d\u8bf4\u660e\u3002<br \/>\n   <br \/>\n   \u53ef\u80fd\u6bd4\u8f83\u7591\u60d1\u4e3a\u4ec0\u4e48\u8981\u521b\u5efaSettingActivity\uff0c\u5173\u4e8e\u4e3a\u4ec0\u4e48\u521b\u5efaSettingActivity,\u5728\u4e0b\u8ff0\u4e2d\u8bf4\u660e\u3002<br \/>\n   <br \/>\n   3.\u5728res\/xml\u4e0b\u521b\u5efaxml\u6587\u4ef6\uff0c\u6211\u8fd9\u91cc\u547d\u540d\u4e3awallpaper.xml,\u4e3a\u4e0a\u8ff0\u4e2dservice\u4e2d\u7684resource:\n  <\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;wallpaper xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n  android:description=\"@string\/app_name\"\n  android:settingsActivity=\"com.example.liuwei.wallpagerdemo.SettingActivity\"\n  android:thumbnail=\"@mipmap\/star\" \/&gt;\n<\/code><\/pre>\n<p>\n   \u5176\u4e2ddescription(\u5e94\u7528\u63cf\u8ff0)settingsActivity(\u5e94\u7528\u6307\u5b9a\u7684\u58c1\u7eb8\u8bbe\u7f6e\u9875\u9762),thumbnail(\u5e94\u7528\u56fe\u6807)\u4e09\u4e2a\u5c5e\u6027\u81ea\u5b9a\u4e49\u8bbe\u7f6e\u3002<br \/>\n   <br \/>\n   4.\u914d\u7f6e\u5de5\u4f5c\u5b8c\u6210\uff0c\u542f\u52a8\u58c1\u7eb8\u670d\u52a1\uff1a<br \/>\n   <br \/>\n   \u901a\u8fc7\u4e0b\u9762\u8fd9\u79cd\u65b9\u5f0f\u6253\u5f00\u58c1\u7eb8\u8bbe\u7f6e\u9875\u9762\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\uff1a\n  <\/p>\n<pre><code>Intent intent = new Intent(\n        WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);\n    intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,\n        new ComponentName(this, MyWallpaperService.class));\n    startActivity(intent);\n<\/code><\/pre>\n<p>\n   \u8fd9\u65f6\u5019\u5fc3\u91cc\u60f3MyWallpaperService\u662fservice,\u90a3\u80fd\u4e0d\u80fd\u901a\u8fc7startService()\u542f\u52a8\u58c1\u7eb8\uff0c\u901a\u8fc7stopService()\u6e05\u9664\u58c1\u7eb8\u5462\uff1f<br \/>\n   <br \/>\n   \u7ecf\u6d4b\u8bd5\uff0c\u4e0d\u80fd\u3002\u8fd9\u4e5f\u662f\u4e0a\u8ff0\u58f0\u660eSettingActivity\u7684\u539f\u56e0\u3002<br \/>\n   <br \/>\n   **\u6240\u4ee5\u542f\u52a8\u58c1\u7eb8\u670d\u52a1\u65f6\uff0c\u4e0d\u80fd\u901a\u8fc7context\u7684startService()\u65b9\u6cd5\u6765\u542f\u52a8\u58c1\u7eb8\u670d\u52a1\uff0c\u9700\u8981\u901a\u8fc7\u542f\u52a8\u7cfb\u7edf\u7684\u9884\u89c8\u754c\u9762\u6765\u95f4\u63a5\u542f\u52a8\u670d\u52a1\u3002**\u4f46\u660e\u660e\u662f\u4e00\u4e2aservice\u4e3a\u4ec0\u4e48\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u80fd\u6210\u529f\u8bbe\u7f6e\u58c1\u7eb8\u5462\uff0c\u5728\u4e0b\u8ff0\u539f\u7406\u4e2d\u8bf4\u660e\u3002<br \/>\n   <br \/>\n   \u901a\u8fc7\u4ee5\u4e0a\u56db\u4e2a\u6b65\u9aa4\u6211\u4eec\u5c31\u53ef\u4ee5\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u4e86\uff0c\u5728\u8fd0\u884capp\u65f6\u70b9\u51fb\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u8fdb\u5165\u5230\u4e0b\u9762\u9875\u9762\uff1a<br \/>\n   \n  <\/p>\n<pre><code>public class SettingActivity extends PreferenceActivity {\n\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    addPreferencesFromResource(R.xml.prefs);\n    Preference circlePreferennce = getPreferenceScreen().findPreference(\"numberOfCircles\");\n    circlePreferennce.setOnPreferenceChangeListener(numberCheckListener);\n  }\n\n  Preference.OnPreferenceChangeListener numberCheckListener = new Preference.OnPreferenceChangeListener() {\n    @Override\n    public boolean onPreferenceChange(Preference preference, Object newValue) {\n      if(newValue != null &amp;&amp; newValue.toString().length() &gt; 0 &amp;&amp; newValue.toString().matches(\"\\\\d*\")){\n        return true;\n      }\n      return false;\n    }\n  };\n}\n<\/code><\/pre>\n<p>\n   res\/xml\u4e0b\u7684prefs.xml\u6587\u4ef6\uff1a\n  <\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;PreferenceScreen xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\n\n  &lt;CheckBoxPreference\n    android:key=\"touch\"\n    android:title=\"Touch\"\/&gt;\n\n  &lt;EditTextPreference\n    android:key=\"numberOfCircles\"\n    android:title=\"Number\"\/&gt;\n&lt;\/PreferenceScreen&gt;\n<\/code><\/pre>\n<p>\n   \u4f7f\u7528PreferenceActivity\u8fd8\u53ef\u4ee5\u505a\u4e00\u4e9b\u5176\u4ed6\u4e8b\u60c5\uff0c\u5173\u4e8ePreferenceActivity\u7684\u7528\u6cd5\u8bf7\u53c2\u8003<br \/>\n   <a href=\"https:\/\/www.jianshu.com\/p\/4a65f4a912c6\" rel=\"nofollow\"><br \/>\n    \u8fd9\u91cc<br \/>\n   <\/a><br \/>\n   <br \/>\n   \u6700\u540e\u5173\u4e8e<br \/>\n   <strong><br \/>\n    \u6e05\u9664\u52a8\u6001\u58c1\u7eb8<br \/>\n   <\/strong><br \/>\n   \uff1a<br \/>\n   <br \/>\n   \u53ef\u4ee5\u4f7f\u7528\u4e0a\u8ff0\u4e2d\u7684\u6e05\u9664\u9759\u6001\u58c1\u7eb8\u7684\u65b9\u6cd5\u8fdb\u884c\u6e05\u9664\uff0c\u6216\u662f\u5982\u4e0b\u5229\u7528WallpaperService\u7684<br \/>\n   <strong><br \/>\n    onDestroy<br \/>\n   <\/strong><br \/>\n   \u65b9\u6cd5\uff1a\n  <\/p>\n<pre><code>if(myWallpaperService != null){\n      myWallpaperService.onDestroy();\n    }\n<\/code><\/pre>\n<p>\n   \u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u89c6\u9891\uff0cgif\u7b49\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\uff0c\u6d41\u7a0b\u76f8\u540c\uff0c\u53ea\u662f\u5728Engine\u4e2d\u7684\u4e0d\u540c\u7684\u5b9e\u73b0\u5bf9\u58c1\u7eb8\u8fdb\u884c\u4e0d\u540c\u7684\u7ed8\u5236\u5de5\u4f5c\uff0c\u540e\u7eed\u6709\u65f6\u95f4\u5b66\u4e60\u4e00\u4e0b\uff0c\u518d\u8865\u5145\u3002<br \/>\n   <br \/>\n   \u5b66\u4e60demo\u70b9\u51fb<br \/>\n   <a href=\"https:\/\/download.csdn.net\/download\/liuwei187\/11069840\"><br \/>\n    \u8fd9\u91cc<br \/>\n   <\/a><br \/>\n   \u3002\n  <\/p>\n<h2>\n   <a id=\"_229\"><br \/>\n   <\/a><br \/>\n   \u539f\u7406<br \/>\n  <\/h2>\n<p>\n   \u77e5\u9053\u4e86\u600e\u6837\u8bbe\u7f6e\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u4e4b\u540e\u5f15\u53d1\u4e00\u4e9b\u601d\u8003\uff1a\u52a8\u6001\u58c1\u7eb8\u9700\u8981\u81ea\u5b9a\u4e49\u7ee7\u627fWallpaperService\uff0c\u5728onCreateEngine\u4e2d\u8fd4\u56deEngine\u5b9e\u73b0\uff0c\u4e3a\u4ec0\u4e48\u9759\u6001\u58c1\u7eb8\u53ea\u9700\u8981\u8c03\u7528WallpaperManager\u7684api\u65b9\u6cd5\u5c31\u53ef\u4ee5\u5462\uff1f\u800c\u52a8\u6001\u58c1\u7eb8\u7ee7\u627fWallpaperService\u4e5f\u5c31\u8bf4\u660e\u4e86\u662f\u4e00\u4e2aservice,\u4e3a\u4ec0\u4e48\u901a\u8fc7startService\u542f\u52a8\u65b9\u5f0f\u4e0d\u80fd\u6210\u529f\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u5462\uff1f\u7cfb\u7edf\u662f\u600e\u6837\u901a\u8fc7WallpaperService\u8fdb\u884c\u901a\u4fe1\u7684\uff1f\u6b64\u65f6\u9700\u8981\u4e86\u89e3\u52a8\u6001\u58c1\u7eb8\u548c\u9759\u6001\u58c1\u7eb8\u7684\u539f\u7406\u4e86\u3002<br \/>\n   <br \/>\n   \u5bf9\u4e8e\u4e0a\u8ff0\u51e0\u4e2a\u7591\u95ee\uff1a<br \/>\n   <br \/>\n   <strong><br \/>\n    1.\u901a\u4fe1\uff1a<br \/>\n   <\/strong><br \/>\n   <br \/>\n   \u52a8\u6001\u58c1\u7eb8\u548c\u9759\u6001\u58c1\u7eb8\u90fd\u662f\u4ee5\u4e00\u4e2aService\u7684\u5f62\u5f0f\u8fd0\u884c\u5728\u7cfb\u7edf\u540e\u53f0\uff0c\u5e76\u5728\u4e00\u4e2a\u7c7b\u578b\u4e3aTYPE_WALLPAPER\u7684\u7a97\u53e3\u4e0a\u7ed8\u5236\u5185\u5bb9\u3002<br \/>\n   <br \/>\n   WallpaperService\u662f\u7531WallpaperManagerService(\u7cfb\u7edfService\uff0c\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\uff0c\u7531\u7cfb\u7edf\u8fdb\u7a0bSystemServer\u521b\u5efa)\u542f\u52a8(\u901a\u8fc7\u7ed1\u5b9a\u670d\u52a1\u7684\u65b9\u5f0f)\u5e76\u7ba1\u7406\u7684\u3002<br \/>\n   <br \/>\n   \u5728\u8bbe\u7f6e\u58c1\u7eb8\u65f6\uff0c\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7WallpaperManager\u901a\u8fc7AIDl\u4e0eWallpaperManagerService\u8fdb\u884c\u901a\u4fe1\u3002<br \/>\n   <br \/>\n   Android\u7684\u52a8\u6001\u5899\u7eb8\u867d\u7136\u4f3c\u4e4e\u662f\u663e\u793a\u5728Launcher\u7684\u80cc\u666f\u91cc\uff0c\u4f46\u5176\u5b9e\u8fd9\u53ea\u662f\u5047\u8c61\uff0c\u52a8\u6001\u5899\u7eb8\u548cLauncher\u662f\u5b8c\u5168\u4e0d\u540c\u7684\u4e24\u4e2a\u8fdb\u7a0b\uff0c\u53ea\u4e0d\u8fc7Launcher\u548c\u52a8\u6001\u5899\u7eb8\u7684\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7\u6846\u67b6\u91cc\u7684WallpaperManager\u8fdb\u884c\u8fdb\u7a0b\u95f4\u901a\u4fe1\u7f62\u4e86\uff0c\u7528\u6237\u5728Launcher\u684c\u9762\u6ed1\u52a8\u3001\u70b9\u51fb\u5c4f\u5e55\u65f6\u6709\u7684\u52a8\u6001\u5899\u7eb8\u80fd\u4ea7\u751f\u4ea4\u4e92\u6548\u679c\uff0c\u5b9e\u9645\u4e0a\u5c31\u662f\u8fd9\u4e2a\u8fdb\u7a0b\u901a\u4fe1\u5b8c\u6210\u7684\u3002\u5982\u679c\u4f60\u901a\u8fc7\u4ee3\u7801\u5c06Launcher\u7684\u80cc\u666f\u8bbe\u7f6e\u4e3a\u975e\u900f\u660e\u7684\uff0c\u6bd4\u5982\u4ee5\u4e0d\u900f\u660e\u7684\u56fe\u7247\u6216\u8005\u989c\u8272\u4f5c\u4e3a\u80cc\u666f\uff0c\u90a3\u4e48\uff0c\u4f60\u5c06\u770b\u4e0d\u5230\u4efb\u4f55\u52a8\u6001\u5899\u7eb8\u6548\u679c\uff0c\u5f53\u7136\uff0c\u8fd9\u6837\u7684\u8bdd\uff0c\u9759\u6001\u5899\u7eb8\u4f60\u4e5f\u4e0d\u4f1a\u770b\u5230\u4e86\u3002<br \/>\n   <br \/>\n   <strong><br \/>\n    2.\u542f\u52a8\u52a8\u6001\u58c1\u7eb8\u65b9\u6cd5\uff1a<br \/>\n   <\/strong><br \/>\n   <br \/>\n   \u67e5\u770b\u6e90\u7801\u53ef\u77e5\uff0c\u542f\u52a8\u52a8\u6001\u58c1\u7eb8\u662f\u901a\u8fc7WallpaperManager.java\u7684<br \/>\n   <strong><br \/>\n    setWallpaperComponent<br \/>\n   <\/strong><br \/>\n   \u8fd9\u4e2a\u65b9\u6cd5\u5b9e\u73b0\u7684\uff0c\u5982\u4e0b\uff1a\n  <\/p>\n<pre><code>@SystemApi\n    @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_COMPONENT)\n    public boolean setWallpaperComponent(ComponentName name) {\n        return setWallpaperComponent(name, mContext.getUserId());\n    }\n<\/code><\/pre>\n<p>\n   setWallpaperComponent\u8fd9\u4e2a\u65b9\u6cd5\u662f\u7cfb\u7edfapi,\u4e0d\u80fd\u76f4\u63a5\u88ab\u5f00\u53d1\u8005\u8c03\u7528\uff0c\u56e0\u6b64\u7b2c\u4e09\u65b9\u5e94\u7528\u7a0b\u5e8f\u662f\u65e0\u6cd5\u8fdb\u884c\u52a8\u6001\u58c1\u7eb8\u7684\u8bbe\u7f6e\u7684,\u53ea\u80fd\u901a\u8fc7\u4e0a\u8ff0\u4e2d\u7684\u65b9\u6cd5\u542f\u52a8\u52a8\u6001\u58c1\u7eb8\u3002<br \/>\n   <br \/>\n   <strong><br \/>\n    3.\u9759\u6001\u58c1\u7eb8\uff1a<br \/>\n   <\/strong><br \/>\n   <br \/>\n   ImageWallpaper\u8868\u793a\u9759\u6001\u58c1\u7eb8\uff0c\u5bf9\u5e94\u9759\u6001\u58c1\u7eb8\uff0c\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e2aImageWallpaper(\u7ee7\u627f\u81eaWallpaperService) \u548cDrawableEngine(\u7ee7\u627f\u81eaEngine)\u3002<br \/>\n   <br \/>\n   \u67e5\u770b\u6e90\u7801\u6df1\u5165\u7406\u89e3\u58c1\u7eb8\u539f\u7406\u8bf7\u70b9\u51fb<br \/>\n   <a href=\"https:\/\/blog.csdn.net\/liuwei187\/article\/details\/88947870\"><br \/>\n    \u8fd9\u91cc<br \/>\n   <\/a>\n  <\/p>\n<h2>\n   <a id=\"_250\"><br \/>\n   <\/a><br \/>\n   \u53c2\u8003<br \/>\n  <\/h2>\n<p>\n   <a href=\"https:\/\/mp.weixin.qq.com\/s\/4_ER7XsObMjRfHGOkOWmhg\" rel=\"nofollow\"><br \/>\n    https:\/\/mp.weixin.qq.com\/s\/4_ER7XsObMjRfHGOkOWmhg<br \/>\n   <\/a><br \/>\n   <br \/>\n   <a href=\"https:\/\/blog.csdn.net\/wangjinyu501\/article\/details\/83317542\"><br \/>\n    https:\/\/blog.csdn.net\/wangjinyu501\/article\/details\/83317542<br \/>\n   <\/a><br \/>\n   <br \/>\n   <a href=\"https:\/\/blog.csdn.net\/qxs965266509\/article\/details\/61925652\"><br \/>\n    https:\/\/blog.csdn.net\/qxs965266509\/article\/details\/61925652<br \/>\n   <\/a><br \/>\n   <br \/>\n   <a href=\"https:\/\/blog.csdn.net\/u012968084\/article\/details\/52160399\"><br \/>\n    https:\/\/blog.csdn.net\/u012968084\/article\/details\/52160399<br \/>\n   <\/a><br \/>\n   <br \/>\n   <a href=\"https:\/\/blog.csdn.net\/leopard21\/article\/details\/32201501\"><br \/>\n    https:\/\/blog.csdn.net\/leopard21\/article\/details\/32201501<br \/>\n   <\/a>\n  <\/p>\n<\/p><\/div>\n<link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/markdown_views-a5d25dd831.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/style-e504d6a974.css\" rel=\"stylesheet\"\/>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e24\u5929\u5728\u516c\u4f17\u53f7\u4e0a\u5076\u7136\u770b\u5230\u4e00\u7bc7\u5173\u4e8e\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u7684\u6587\u7ae0\uff0c\u89c9\u5f97\u86ee\u6709\u610f\u601d\u7684\uff0c\u5b66\u4e60\u4e86\u4e00\u4e0b\uff0c\u4ee5\u6b64\u6587\u7ae0\u8bb0\u5f55\u4e00\u4e0b\u600e\u6837\u7ed9\u624b\u673a\u8bbe\u7f6e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1805","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51<\/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.wunen.com\/index.php\/2025\/05\/06\/android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"og:description\" content=\"\u8fd9\u4e24\u5929\u5728\u516c\u4f17\u53f7\u4e0a\u5076\u7136\u770b\u5230\u4e00\u7bc7\u5173\u4e8e\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u7684\u6587\u7ae0\uff0c\u89c9\u5f97\u86ee\u6709\u610f\u601d\u7684\uff0c\u5b66\u4e60\u4e86\u4e00\u4e0b\uff0c\u4ee5\u6b64\u6587\u7ae0\u8bb0\u5f55\u4e00\u4e0b\u600e\u6837\u7ed9\u624b\u673a\u8bbe\u7f6e [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-05T16:00:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"180\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin@wunen\" \/>\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@wunen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/\"},\"author\":{\"name\":\"admin@wunen\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\"},\"headline\":\"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3\",\"datePublished\":\"2025-05-05T16:00:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/\"},\"wordCount\":151,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.wunen.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"articleSection\":[\"\u52a8\u6001\u58c1\u7eb8\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/\",\"url\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/\",\"name\":\"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"isPartOf\":{\"@id\":\"https:\/\/www.wunen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"datePublished\":\"2025-05-05T16:00:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"width\":260,\"height\":180},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wunen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wunen.com\/#website\",\"url\":\"https:\/\/www.wunen.com\/\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"description\":\"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9\",\"publisher\":{\"@id\":\"https:\/\/www.wunen.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wunen.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.wunen.com\/#organization\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"url\":\"https:\/\/www.wunen.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"width\":1024,\"height\":1024,\"caption\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\"},\"image\":{\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\",\"name\":\"admin@wunen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"caption\":\"admin@wunen\"},\"sameAs\":[\"http:\/\/www.wunen.com\"],\"url\":\"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","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.wunen.com\/index.php\/2025\/05\/06\/android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3\/","og_locale":"zh_CN","og_type":"article","og_title":"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","og_description":"\u8fd9\u4e24\u5929\u5728\u516c\u4f17\u53f7\u4e0a\u5076\u7136\u770b\u5230\u4e00\u7bc7\u5173\u4e8e\u8bbe\u7f6e\u52a8\u6001\u58c1\u7eb8\u7684\u6587\u7ae0\uff0c\u89c9\u5f97\u86ee\u6709\u610f\u601d\u7684\uff0c\u5b66\u4e60\u4e86\u4e00\u4e0b\uff0c\u4ee5\u6b64\u6587\u7ae0\u8bb0\u5f55\u4e00\u4e0b\u600e\u6837\u7ed9\u624b\u673a\u8bbe\u7f6e [&hellip;]","og_url":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3\/","og_site_name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","article_published_time":"2025-05-05T16:00:10+00:00","og_image":[{"width":260,"height":180,"url":"https:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","type":"image\/jpeg"}],"author":"admin@wunen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin@wunen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#article","isPartOf":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/"},"author":{"name":"admin@wunen","@id":"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8"},"headline":"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3","datePublished":"2025-05-05T16:00:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/"},"wordCount":151,"commentCount":0,"publisher":{"@id":"https:\/\/www.wunen.com\/#organization"},"image":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","articleSection":["\u52a8\u6001\u58c1\u7eb8"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/","url":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/","name":"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3 - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","isPartOf":{"@id":"https:\/\/www.wunen.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage"},"image":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","datePublished":"2025-05-05T16:00:10+00:00","breadcrumb":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#primaryimage","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","width":260,"height":180},{"@type":"BreadcrumbList","@id":"https:\/\/www.wunen.com\/index.php\/2025\/05\/06\/android%e9%9d%99%e6%80%81%e5%a3%81%e7%ba%b8%e5%92%8c%e5%8a%a8%e6%80%81%e5%a3%81%e7%ba%b8%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e7%90%86%e8%a7%a3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wunen.com\/"},{"@type":"ListItem","position":2,"name":"Android\u9759\u6001\u58c1\u7eb8\u548c\u52a8\u6001\u58c1\u7eb8\u7684\u4f7f\u7528\u548c\u7406\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.wunen.com\/#website","url":"https:\/\/www.wunen.com\/","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","description":"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9","publisher":{"@id":"https:\/\/www.wunen.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wunen.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/www.wunen.com\/#organization","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","url":"https:\/\/www.wunen.com\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","width":1024,"height":1024,"caption":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51"},"image":{"@id":"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8","name":"admin@wunen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wunen.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","caption":"admin@wunen"},"sameAs":["http:\/\/www.wunen.com"],"url":"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/"}]}},"_links":{"self":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/1805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/comments?post=1805"}],"version-history":[{"count":0,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/1805\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media?parent=1805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/categories?post=1805"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/tags?post=1805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}