Hi,
I am facing problem in setting the background of a view as current 
wallpaper. 
Note here, the the custom view is not the one which is inflated by 
setContentView in the main activity. The custom view is displayed on a 
button press.
Have tried using, 
WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
Drawable wallpaperDrawable = wallpaperManager.peekDrawable();
wallpaperDrawable = wallpaperManager.getDrawable();
mCustomView.setBackgroundDrawable(wallpaperDrawable);

This sets the wallpaper but fails in the case when current wallpaper is a 
Live wallpaper. 
(http://developer.android.com/reference/android/app/WallpaperManager.html 
clearly states: It retrieves the current system wallpaper; if no wallpaper 
is set, the system default wallpaper is returned. This is returned as an 
abstract Drawable that you can install in a View to display whatever 
wallpaper the user has currently set.)

Other way which I tried was, setting the background of the view as 
Transparent
mCustomView.setBackgroundDrawable(new ColorDrawable(0))
This would make the the homescreen live wallpaper visible but here, the 
items (shortcuts, folders, widgets etc) in the homescreen would also be 
visible. 

I understand that setting the Theme of the activity with Wallpaper theme 
would make the main layout with current wallpaper(live wallpaper works as 
well). But this doesnot hold good in my case as the custom view is not the 
main layout that is inflated by setContentView.

Kindly let me know how to achieve this.

Thanks in advance,
Nishma

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to