【问题标题】:Set Android live wallpaper by code, without user interaction通过代码设置Android动态壁纸,无需用户交互
【发布时间】:2012-04-05 02:26:02
【问题描述】:

我想通过代码在Android中自动设置动态壁纸,无需任何用户界面选择壁纸。

简单的壁纸设置可以通过代码自动设置:

final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
final Drawable wallpaperDrawable = wallpaperManager.getDrawable(); 
final ImageView imageView = (ImageView) findViewById(R.id.imageview);
imageView.setDrawingCacheEnabled(true); 
imageView.setImageDrawable(wallpaperDrawable);

现在我必须使用服务自动设置动态壁纸,以便每天在屏幕上自动设置动态壁纸。

我该怎么做?

【问题讨论】:

    标签: android service live-wallpaper


    【解决方案1】:

    Android 操作系统不允许您以编程方式设置动态壁纸。您只能对静态壁纸执行此操作。你能得到的最接近的是使用这个方法:Setting live wallpaper programmatically

    【讨论】:

    • 感谢您的回复,许多研发人员现在决定 Android 操作系统不允许我们以编程方式设置动态壁纸。我怎么知道安卓操作系统不支持这个东西?如果您对此限制有任何诽谤网址,请分享给我。
    • 果冻豆现在支持以编程方式更改动态壁纸,无需用户交互 :)
    • @Adnan Mulla 你能告诉我怎么做吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多