From 3d2f3df7d1b84e3867abfa49b6d1e8993a6a1b14 Mon Sep 17 00:00:00 2001 From: Juan Jose Silveira Date: Tue, 20 Oct 2015 00:42:08 +0100 Subject: [PATCH] Use ACTION_CHANGE_LIVE_WALLPAPER for the Set Wallpaper button. Also set the extra EXTRA_LIVE_WALLPAPER_COMPONENT so that a preview of the Meter wallpaper is shown directly instead of showing a list of all live wallpapers. Tested on a Nexus 5X with Marshmallow and Google Now Launcher. --- .../main/java/com/androidexperiments/meter/MainActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/androidexperiments/meter/MainActivity.java b/app/src/main/java/com/androidexperiments/meter/MainActivity.java index 96f2880..702a46d 100644 --- a/app/src/main/java/com/androidexperiments/meter/MainActivity.java +++ b/app/src/main/java/com/androidexperiments/meter/MainActivity.java @@ -2,6 +2,7 @@ import android.app.Activity; import android.app.WallpaperManager; +import android.content.ComponentName; import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; @@ -53,7 +54,9 @@ public void onClick(View v) { mSetWallpaperBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Intent intent = new Intent(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER); + Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER); + intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, + new ComponentName(getApplication(), MeterWallpaper.class)); startActivity(intent); } });