SOLVED! Glide Library Placeholder problems method while caching images


You might have realized from the latest versions of Glide Image Loader, it does not resolve methods such as placeholder(drawable), fitCenter(), e.t.c. Under this walkthrough, we are going to see how to solve this Glide Library Placeholder problems.

Glide Image Caching library, can’t resolve the placeholder method

You might think that this is a problem or maybe the newest versions of Glide are missing some important features. Well, that not the case, you can still use the .placeholder() with the latest versions of Glide, you just have to add it as applied RequestOption in the method chain. Please have a look at the code below



package ke.co.potent_mshop.mshopmarket;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

public class GlideTestingApplication {

    private void loadingTesting(Context context, ImageView imageView){
        Glide.with(context).load("image url").apply(new RequestOptions().placeholder(R.drawable.ic_launcher_background)).into(imageView);
    }

}

Feel free to copy paste the code into your project files. You can still watch the following video to see how to figure out this



VIDEO: Glide Library Placeholder issues solved