Glide Version:
glide:4.0.0
Integration libraries:
okhttp:3.3.1
com.android.volley:volley:1.0.0
jp.wasabeef:glide-transformations:2.0.2
Device/Android Version:
Android 6.0, 5.0, 4.2
Issue details / Repro steps / Use case background:
Glide load line / GlideModule (if any) / list Adapter code (if any):
Glide.with...
```
Glide.with(getApplicationContext()).asBitmap().load(strURL).into(new SimpleTarget
@Override
public void onResourceReady(Bitmap bitmap, Transition<? super Bitmap> transition) {
if (bitmap != null) {
NotificationCompat.BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle();
bigPictureStyle.bigPicture(bitmap);
notificationBuilder.setStyle(bigPictureStyle);
Notification notification = notificationBuilder.build();
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notification);
}
}
});
Stack trace / LogCat:
paste stack trace and/or log here
You must call this method on the main thread
When I received a notification, the app crash because of Glide.with(getApplicationContext()).
Called at MyFirebaseMessagingService.onMessageReceived()
I found the answer is....
final NotificationTarget target = new NotificationTarget(context, R.id.imgBigImage, rv, notification, 0);
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Glide.get(getApplicationContext()).clearMemory();
Glide.with(getApplicationContext())
.asBitmap()
.load(strURL)
.into(target);
}
});
Thank you!
@kenneth2008 can you please update us with the syntax for the latest version of Glide?
Most helpful comment
I found the answer is....