I have a custom .png image set as my Android device's wallpaper.
As I understand it, wallpaper size should be 960x800 pixels but the Android device will only present the middle part of the image and the extra right and left parts are for when you scroll right and left on the screen. So I’ve taken a small image that I want it to be in the center of the screen (350x350) and filled the rest of the image with a black surrounding.
My problem is: I have an activity in my application that needs its background to be similar to the wallpaper (to imitate a blank activity with just a TextView presented on it). I’m using this code to do so:
private WallpaperManager wallpaperManager;
private Drawable wallpaperDrawable;
private RelativeLayout rtemp;
rtemp = (RelativeLayout)findViewById(R.id.temp_layout);
wallpaperManager = WallpaperManager.getInstance(this);
wallpaperDrawable = wallpaperManager.getDrawable();
rtemp.setBackground(wallpaperDrawable);
But the screen appears to have the wallpaper as a whole and not just the middle part anymore (it basically shrink down the image) and it is not consistent with the regular wallpaper anymore.
Are there any suggestions on how to solve it? Is there a way to avoid image shrinking on the activity or is there a way to make the image not spread as the wallpaper screen?
Thanx a lot!