0

I am making a wallpaper application, i have one issue: when i try to click my button "Set background", it sets the background but it is zoomed in and because of that i lost half of my original image. This is the code that i am using:

try {

                    Display d = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
                    int width = d.getWidth();
                    int height = d.getHeight();


                    WallpaperManager wallpaperManager = WallpaperManager.getInstance(view.getContext());

                    Bitmap bitmap = null;

                    bitmap = Bitmap.createScaledBitmap(bmpWallpaper, width, height, false);
                    wallpaperManager.setBitmap(bitmap);


                    Core.makeNotification(view.getContext(), "MyNotification", "Your wallpaper has been set, enjoy!");
                    Core.makeAlert(view.getContext(), "Wallpaper set", "Your wallpaper has been set, enjoy!");

                } catch (IOException e) {
                    e.printStackTrace();
                }
Maxim
  • 3,836
  • 6
  • 42
  • 64

1 Answers1

0

i had the same problem and fix it by multiplying the size by 2 for each photo for example 2160*1920 instead of 1080*960 for all variations specially Galaxy S4

by multiplying the size by 2 i mean by that; the image it self not doing it programmatically

mmoghrabi
  • 1,233
  • 1
  • 14
  • 23