【问题标题】:how to set GIF as wallpaper using WallpaperManager如何使用 WallpaperManager 将 GIF 设置为壁纸
【发布时间】:2018-03-15 06:54:09
【问题描述】:

如何在 android 的 WallpaperManager 中设置壁纸中的 GIF。

提前致谢。

【问题讨论】:

  • 欢迎来到 Stack Overflow!请更详细地描述您的问题。到目前为止,您尝试过什么?

标签: android live-wallpaper android-wallpaper


【解决方案1】:

我想这会对你有所帮助

Intent i = new Intent();

if(Build.VERSION.SDK_INT > 15){
i.setAction(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);

String p = HypercaneWallpaperService.class.getPackage().getName();
String c = HypercaneWallpaperService.class.getCanonicalName();        
i.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(p, c));
}
else{
i.setAction(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
}
getActivity().startActivityForResult(i, 0);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-16
    相关资源
    最近更新 更多