Want to set wallpaper by using wallpaper manager without cropping

         StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
            StrictMode.setThreadPolicy( policy );

            WallpaperManager wpm = WallpaperManager.getInstance( getApplicationContext() );
            InputStream ins = null;
            try {
                ins = new URL( Imageurl ).openStream();
                wpm.setStream( ins );
                Toast.makeText( ImageViewerActivity.this, "wallpaper set successfully", Toast.LENGTH_SHORT ).show();
            } catch (IOException e) {
                e.printStackTrace();
            }

orignal Image

after setting it as wallpaper

0 Answers