I built my first Android app.
It is a Live Wallpaper designed for 2.2.
When I press and hold the screen, select Wallpapers
and then select Live Wallpapers
, my live wallpaper has what looks like a default icon with the name of my live wallpaper overlaid.
How do I set this icon?
My manifest file has an application icon specified as @drawable/icon
Update
I think I need to add some info to this question as it poorly describes my problem (sorry).
res/drawable-[hml]dpi/
icons. I named them all icon.png
.<application android:label="@string/app_name" android:icon="@drawable/icon">
res/drawable/
called icon.png
.Manage Applications
, the icon is displayed correctly.mdpi
icon is 48x48, ldpi
icon is 36x36 and hdpi
icon is 72x72In 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