@Chitransh: Thank you for responding. Well setting the background with a image can be achieved using that line of code but I am interested in setting the current wallpaper of the device as the background of my custom view.
On Monday, July 23, 2012 6:51:41 PM UTC+5:30, Chitransh Mathur wrote: > > @ Nishma: > > plz try this... > android:background="@drawable/your background image name" > > > > On Mon, Jul 23, 2012 at 6:47 PM, nishma <[email protected]> wrote: > >> 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.htmlclearly >> 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 > > > > > -- > > Thanks, > *Chitransh Mathur* > Software Engineer, NCS^ P Ltd, Indore > Cell : +91 80852-193-55 > Email : [email protected] <[email protected]> > URL : www.nenosystems.com > > > > > © Copyright NCS Pvt Ltd. 2011 > Unless otherwise explicitly stated, all rights including those in > copyright in the content of this e-mail are owned by NCS Pvt Ltd. The > contents of this e-mail shall not be copied, reproduced, or transmitted in > any form without the written permission of NCS Pvt. Ltd. or that of the > copyright owner. The receipt of this mail is the acknowledgement of the > receipt of contents; if the recipient is not the intended addressee then > the recipient shall notify the sender immediately. > -- 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

