I am using Glide v4 and it is not always can get bitmap from Url. Sometimes it works and Sometimes it does not work and throw an exception. I don't know why. this is the Exception:java.lang.IllegalArgumentException: You must call this method on a background thread
and this is my code:
try {
bitmap=Glide.with(mContext.getApplicationContext())
.asBitmap().load(icon).fitCenter()
.circleCrop().submit().get();
} catch (Exception e) {
bitmap= BitmapFactory.decodeResource(mContext.getResources(),
R.drawable.ic_default_user_image);
}
I am facing another problem with Glide, this is the issue I made on Glide Github : https://github.com/bumptech/glide/issues/3590