【发布时间】:2018-03-15 06:54:09
【问题描述】:
如何在 android 的 WallpaperManager 中设置壁纸中的 GIF。
提前致谢。
【问题讨论】:
-
欢迎来到 Stack Overflow!请更详细地描述您的问题。到目前为止,您尝试过什么?
标签: android live-wallpaper android-wallpaper
如何在 android 的 WallpaperManager 中设置壁纸中的 GIF。
提前致谢。
【问题讨论】:
标签: android live-wallpaper android-wallpaper
我想这会对你有所帮助
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);
【讨论】: