I would like to set a wallpaper from the gallery. The selected image will have to use the CropImage class of the device.
The problem is that every device have a different CropImage class, so when im using "Crop" action, the CropImage of the device opens, but not all set as a wallper.
Code:
Intent cropperIntent = new Intent("com.android.camera.action.CROP", chosenImageUri);
cropperIntent.setDataAndType(chosenImageUri, "image/*");
cropperIntent.putExtra("crop", true);
cropperIntent.putExtra("aspectX", outSize.x);
cropperIntent.putExtra("aspectY", outSize.y);
cropperIntent.putExtra("outputX", outSize.x);
cropperIntent.putExtra("outputY", outSize.y);
cropperIntent.putExtra("width", outSize.x);
cropperIntent.putExtra("height", outSize.y);
cropperIntent.putExtra("scale", true);
cropperIntent.putExtra("noFaceDetection", true);
cropperIntent.putExtra("set-as-wallpaper", true); // for: com.android.gallery3d.app.CropImage
cropperIntent.putExtra("setWallpaper", true); // for: com.android.camera.CropImage
For some devices its not set as wallpaper at all (Like HTC). Maybe have to set another extra like the "set-as-wallpaper" and "set-as-wallpaper"...
Is there a generic method to set the wallpaper with it's cropper for all devices?