Glide assert: java.lang.IllegalArgumentException: You must call this method on the main thread
<p>Has anyone used Glide to fetch images from a background thread? I keep getting this assert:</p>

<pre><code>java.lang.IllegalArgumentException: You must call this method on the main thread
</code></pre>

<p>but according to this thread, it should work:</p>

<p><a href="https://github.com/bumptech/glide/issues/310" rel="noreferrer">https://github.com/bumptech/glide/issues/310</a></p>

<p>Yet, I cannot get it to work, unless I call it from the main thread.</p>

<p>Here's is what I am trying to do from the main thread:</p>

<pre><code>    Glide.get(mContext);
    loadUserImage(userImageUrl);

    // wait 5 seconds before trying again
    int imageLoadingTimeOut = mContext.getResources().getInteger(R.integer.image_loading_time_out);
    if (imageLoadingTimeOut &gt; 0) {
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                if (!mUserImageLoaded) {
                    loadUserImage(userImageUrl);
                }
            }
        }, imageLoadingTimeOut);
    }
}
</code></pre>

<p>and the loadUserImage:</p>

<pre><code>private boolean mUserImageLoaded = false;

private void loadUserImage(String userImageUrl) {

    if (userImageUrl != null &amp;&amp; !userImageUrl.isEmpty() &amp;&amp; !mUserImageLoaded) {
        Glide.with(mContext).using(Cloudinary.getUrlLoader(mContext)).load(userImageUrl).crossFade().listener(new RequestListener&lt;String, GlideDrawable&gt;() {

            @Override
            public boolean onException(Exception e, String model, Target&lt;GlideDrawable&gt; target, boolean isFirstResource) {
                return false;
            }

            @Override
            public boolean onResourceReady(GlideDrawable resource, String model, Target&lt;GlideDrawable&gt; target, boolean isFromMemoryCache, boolean isFirstResource) {
                mImageMessageContent.invalidate();
                mUserImageLoaded = true;
                return false;
            }
        }).into(mImageMessageContent);

    } else {
        mImageMessageContent.setVisibility(View.GONE);
    }
}
</code></pre>

<p>and mContext is just the activity "this" pointer.</p>

<p>Anyway, can I use Glide from a thread different than main?</p>