How to set wallpaper in Android

爷,独闯天下 提交于 2019-12-20 14:20:43

问题


I am using Android SDK 1.6. Could someone tell me how to set an image as the wallpaper in the homescreen.

getApplicationContext().setWallpaper(); 

seems to be not working for me.


回答1:


You have to add the SET_WALLPAPER permission to your AndroidManifest.xml

<manifest xlmns:android...>
 ...
 <uses-permission android:name="android.permission.SET_WALLPAPER" />
</manifest>


来源:https://stackoverflow.com/questions/2856993/how-to-set-wallpaper-in-android

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