How to set wallpaper in Android
Asked Answered
U

1

7

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.

Underhand answered 18/5, 2010 at 12:0 Comment(1)
Although "getApplicationContext().setWallpaper();" works, it's not a good idea to use it because is deprecated. The best option nowadays is to use Wallpaper ManagerPaginate
P
32

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

<manifest xlmns:android...>
 ...
 <uses-permission android:name="android.permission.SET_WALLPAPER" />
</manifest>
Persistence answered 18/5, 2010 at 12:50 Comment(2)
XaB - please mark this topic "answered" so it goes off the "unanswered questions" list (and Cristian gets the points he deserves.)Stative
Thanks for your comment. Unfortunately, the user that creates the question is not too experienced at using StackOverflow. It happens everyday. Bye!Persistence

© 2022 - 2024 — McMap. All rights reserved.