Getting all system wallpapers

荒凉一梦 提交于 2019-12-09 16:48:21

问题


Is there a way to programatically get all the android system wallpapers?

I know how to get the current one, via WallpaperManager, and then save it to disk. But I want to know if there is a way to access all the pictures that act as system wallpaper included with the O.S.


回答1:


All the wallpapers are located in the launcher app. As the name of the launcher and its resources may vary accross devices, there is no way to create a reliable way to do this.

On stock Android the wallpapers are located in Launcher2.apk:res/drawable-somedpi. On my devices they were in the drawable-hdpi folder, but this may be different on others.

First get the resources of the launcher (com.android.Launcher2.apk) as described in this answer.

Then you can list the resources, using a method similar to the one in this question.

I haven't tried out all this myself, so it might not work as expected.




回答2:


Just figure out where they are saved and access them that way.



来源:https://stackoverflow.com/questions/10566975/getting-all-system-wallpapers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!