我正在尝试在 android 2.x 中实现以下内容。
在我的应用程序中,我希望允许用户创建自定义动态壁纸类型的东西,用户选择很少的图像,然后这些图像将以典型的方式旋转,之后用户将能够将所有视图设置为动态壁纸仅在应用程序内。
我已经成功实现了图像的选择及其旋转现在我不知道如何在应用程序中设置动态壁纸。我已经尝试实现动态壁纸选择器,但它用于访问已安装的动态壁纸。但是动态创建的动态壁纸呢?
即使我尝试使用以下代码行来调用它
intent.setClassName("com.android.wallpaper.livepicker", "com.android.wallpaper.livepicker.LiveWallpaperPreview");
但这给了我一个错误
java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview } from ProcessRecord{43f94a38 29784:com.vb.ui/10038} (pid=29784, uid=10038) requires null
可能有几种方法,但我不确定
是否可以以编程方式安装动态壁纸 apk,以便在创建动态壁纸后由应用程序安装它?
if live wallpapers are stored in some place then we can store user created live wallpaper at that place so when live wallpaper chooser is being selected we can see the live wallpaper in the list