何かが廃止された場合、それは開発者がそれを行うためのより良い方法を作成したことを意味し、古い方法や廃止された方法を使用するべきではなくなったことを意味します。非推奨のものは、将来削除される可能性があります。
あなたの場合、画像パスがある場合に壁紙を設定する正しい方法は次のとおりです。
is = new FileInputStream(new File(imagePath));
bis = new BufferedInputStream(is);
Bitmap bitmap = BitmapFactory.decodeStream(bis);
Bitmap useThisBitmap = Bitmap.createScaledBitmap(
bitmap, parent.getWidth(), parent.getHeight(), true);
bitmap.recycle();
if(imagePath!=null){
System.out.println("Hi I am try to open Bit map");
wallpaperManager = WallpaperManager.getInstance(this);
wallpaperDrawable = wallpaperManager.getDrawable();
wallpaperManager.setBitmap(useThisBitmap);
画像 URI がある場合は、次を使用します。
wallpaperManager = WallpaperManager.getInstance(this);
wallpaperDrawable = wallpaperManager.getDrawable();
mImageView.setImageURI(imagepath);
この質問に対するMaidulの回答から。