How to set the Android Live Wallpaper icon (aka “thumbnail”)

前端 未结 7 2301
独厮守ぢ
独厮守ぢ 2021-02-19 05:01

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 L

7条回答
  •  一生所求
    2021-02-19 05:27

    In order to see an icon in the live wallpaper menu, you need to set the android:thumbnail attribute for the applications 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

    
    

    NOTE: this works regardless of file extension, assuming that the format is a supported type - jpg. png etc

提交回复
热议问题