I am trying to set gif wallpaper but the app crashes. This works fine with simple images(png, jpg)
Error message:
java.lang.ClassCastException: com.bumptech.glide.load.resource.gif.GifDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
Glide.with(this).load(getIntent().getStringExtra("images")).into(imageView);
Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
WallpaperManager manager = WallpaperManager.getInstance(getApplicationContext());
try {
manager.setBitmap(bitmap);
Toasty.success(getApplicationContext(), "Set Wallpaper Successfully", Toast.LENGTH_SHORT, true).show();
}
catch (IOException e) {
Toasty.warning(this, "Wallpaper not load yet!", Toast.LENGTH_SHORT, true).show();
}
I want to set gif wallpaper(Live wallpaper)