I am using relativelayout to set an image.Why I hadn\'t using imageview means, inside relativelayout image, I am setting icons.
I dont know what is the issue exactly
Inspired from a GitHub thread, I am using this before loading any image
final Context context = getContext();
if (isValidContextForGlide(context) {
// Load image via Glide lib using context
}
public static boolean isValidContextForGlide(final Context context) {
if (context == null) {
return false;
}
if (context instanceof Activity) {
final Activity activity = (Activity) context;
if (activity.isDestroyed() || activity.isFinishing()) {
return false;
}
}
return true;
}