i'm currently building an app and i want to change the wallpaper. So here is my code. When the user sets the wallpaper i save the path to Shared Preferences.
Display display = getWindowManager().getDefaultDisplay();
SharedPreferences prefs = getBaseContext().getSharedPreferences(PREFS_NAME,0);
if (prefs.contains(d)) {
Bitmap bitmapOrg = BitmapFactory.decodeFile(prefs.getString(d, ""));
int newWidth = display.getWidth();
int newHeight = display.getHeight();
Bitmap resizedBitmap =Bitmap.createScaledBitmap(bitmapOrg, newWidth, newHeight, true);
myWallpaperManager.setBitmap(resizedBitmap);
}
and with that code i got something like this while i want to show the pictures like this
any idea how to do this?