Reputation: 3054
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.
Upvotes: 5
Views: 4587
Reputation: 9480
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?)
Upvotes: 2