5

I am developing an application which allow user to take photo and can set the photo home screen wallpaper.
My problem is that after setting the wallpaper the wallpaper is set in small size not as other wallpaper. and when viewed from gallery the image is in usual size. I can not figure out what is the problem. Code to get the image is as follows:

Code to get the photo after snapshot:

if (resultCode == RESULT_OK){
    Bundle extras = data.getExtras();
    bmp = (Bitmap) extras.get("data");
    iv.setImageBitmap(bmp);
}


Code to set the wallpaper:

getApplicationContext().setWallpaper(bmp);


Please help me out with this.

aman.nepid
  • 2,864
  • 8
  • 40
  • 48
  • 1
    Did you try to check on the image size before set to wallpaper? Try bmp.getWidth() and bmp.getHeight() – Fon Sep 26 '11 at 03:36

1 Answers1

2

There is informations to set a wallpaper here : http://android-er.blogspot.in/2011/03/set-wallpaper-using-wallpapermanager.html

You can simply do like this :

 WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
 wallpaperDrawable = wallpaperManager.getDrawable();
 mImageView.setImageURI(imagePath);

(also see this post : Android - How to set the wallpaper image?)

Community
  • 1
  • 1
Fabien Sa
  • 9,135
  • 4
  • 37
  • 44