Code example for WallpaperManager

Methods: clearforgetLoadedWallpaper, getBitmap

0
                    // draw it once and then we'll let the window manager 
                    // position it appropriately.  As such, we no longer needed 
                    // the loaded bitmap.  Yay! 
                    // hw-accelerated path retains bitmap for faster rotation 
                    mBackground = null;
                    mWallpaperManager.forgetLoadedWallpaper();
                } 
            } 
 
        } 
 
        private void updateWallpaperLocked() { 
            Throwable exception = null;
            try { 
                mBackground = null;
                mBackground = mWallpaperManager.getBitmap();
            } catch (RuntimeException e) {
                exception = e;
            } catch (OutOfMemoryError e) {
                exception = e;
            } 
 
            if (exception != null) {
                mBackground = null;
                // Note that if we do fail at this, and the default wallpaper can't 
                // be loaded, we will go into a cycle.  Don't do a build where the 
                // default wallpaper can't be loaded. 
                Log.w(TAG, "Unable to load wallpaper!", exception);
                try { 
                    mWallpaperManager.clear();
                } catch (IOException ex) {
                    // now we're really screwed. 
                    Log.w(TAG, "Unable reset to default wallpaper!", ex);
                } 
            }