首页 > 解决方案 > 更新应用时删除动态壁纸

问题描述

我的应用程序提供了一个动态壁纸,它是通过子类化WallpaperService. 那里没有什么不寻常的地方。

我的清单声明墙纸是这样的:

<service
    android:name=".feature.wallpaper.AppWallpaperService"
    android:enabled="true"
    android:label="@string/wallpaper_label"
    android:permission="android.permission.BIND_WALLPAPER"
    android:icon="@mipmap/ic_launcher_round">
    <intent-filter>
         <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    <meta-data
         android:name="android.service.wallpaper"
         android:resource="@xml/wallpaper" />
</service>

从应用程序中设置壁纸,也可以通过系统的壁纸设置完美运行。

但是,当应用程序更新(通过 Android Studio 或 Play 商店)时,我的壁纸将被默认的 Android 壁纸替换。

如何确保壁纸比应用更新更有效?

附带说明:系统重启就像一个魅力。

标签: androidandroid-wallpaper

解决方案


推荐阅读