How can I set a wallpaper which looks good for both Landscape and Portrait mode? The code I am using set the live wallpaper only in One mode either in portrait or landscape. Suppose if I set the wallpaper in Portrait mode and go to home screen and change the orientation to Landscape, the wallpaper is fitting only half of the screen in Landscape mode and the other half is showing blank screen. Please help me in this.
WallpaperManager wallpaperManager =WallpaperManager.getInstance(getBaseContext());
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int height = metrics.heightPixels;
int width = metrics.widthPixels;
Bitmap wallpaper = Bitmap.createScaledBitmap(bitmap1,width,height, true);
Canvas canvas = new Canvas(wallpaper);
imageView.draw(canvas);
textView.draw(canvas);
try {
wallpaperManager.setBitmap(wallpaper);
wallpaperManager.suggestDesiredDimensions(width,height);
}
catch (IOException e) {
Toast.makeText(FullImageActivity.this,
"Error setting wallpaper", Toast.LENGTH_SHORT)
.show();
}