Code example for WallpaperManager

Methods: setBitmap

0
        try { 
            WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
//            wpm.setResource(mImages.get(position)); 
            Bitmap bmp = loadWallpaperBitmap(mImages.get(position));
            if(bmp != null){
            	wpm.setBitmap(bmp);
            	setResult(RESULT_OK);
            }else{ 
            	Log.e(TAG, "selectWallpaper error! id="+mImages.get(position));
            	setResult(RESULT_CANCELED);
            } 
            finish();
        } catch (IOException e) {
            Log.e(TAG, "Failed to set wallpaper: " + e);
        } 
    } 
	 
    private Bitmap loadWallpaperBitmap(int resId) {
		final Resources res = mResources;
		Bitmap bitmap = null;
Stop searching for code, let great code find you!  Add Codota to your java IDE