V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nnegier
V2EX  ›  Android

为什么部分 Android13 手机如 vivo、小米设置应用动态壁纸能生效,但是会自动转为静态壁纸

  •  
  •   nnegier · Jun 17, 2023 · 11420 views
    This topic created in 1048 days ago, the information mentioned may be changed or developed.
    // 如果是动态壁纸返回动态壁纸的信息,如果是静态壁纸会返回 null
    WallpaperInfo wallpaperInfo = wallpaperManager.getWallpaperInfo();
    

    我是壁纸应用成功后(桌面上看到实际效果正常),判断这个是否为 null 来知道它变成了静态壁纸了。

    如果不是 Android13 ,或者如果是 Android13 但品牌是三星就是正常的,WallpaperService#Engine 能正常回调。

    不知道原因,折腾一天了,无果

    Supplement 1  ·  Jun 18, 2023
    不能用这个方法来判断是否壁纸应用成功,至于为什么不行我也不知道,这个最好是在 Engine 里的 onCreate 和 onDestroy 通过判断它们的次数来判断是否应用成功,这个可行
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2413 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:53 · PVG 23:53 · LAX 08:53 · JFK 11:53
    ♥ Do have faith in what you're doing.