How to set the Android Live Wallpaper icon (aka "thumbnail")
In order to see an icon in the live wallpaper menu, you need to set the android:thumbnail
attribute for the applications <Wallpaper>
tag. This will normally be found in the XML file corresponding to the class that extends WallpaperService
.
Looking at the CubeLiveWallpaper
sample application provided with the SDK, we see this tag to be located in cube1.xml and cube2.xml. A modified version below displays the icon thumb.png located in res/drawable
and provides a description defined in strings.xml
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android" android:thumbnail="@drawable/thumb" android:description="@string/description" android:settingsActivity="com.example.android.livecubes.cube2.CubeWallpaper2Settings"/>
NOTE: this works regardless of file extension, assuming that the format is a supported type - jpg. png etc
I've set <application android:icon="@drawable/icon"/>
in my AndroidManifest.xml and it's working fine for each icon.png I'm using in the
/res/drawable- :== hdpi | ldpi | mdpi
folders.