glide 设置head

GlideUrl cookie = new GlideUrl(qrCodeImageUrl, new Headers() {
    @Override
    public Map getHeaders() {
        return Util.getHeaders(PayActivity.this);
    }
});
GlideApp.with(this).load(cookie).listener(new RequestListener() {
    @Override
    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
        return false;
    }

    @Override
    public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) {

        return false;
    }
}).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(mQrCodeImage);

你可能感兴趣的:(android)