<p dir="auto">I see that the libraries are using viewless Fragments to do work. This creates a problem where under some circumstance, would conflict with other fragment transactions that fragment manager is doing<br>
The full stacktrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" java.lang.IllegalStateException: Recursive entry to executePendingTransactions
        at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1457)
        at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:482)
        at com.bumptech.glide.manager.RequestManagerRetriever.supportFragmentGet(RequestManagerRetriever.java:148)
        at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:66)
        at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:29)
        at com.bumptech.glide.Glide.with(Glide.java:537)"><pre class="notranslate"><code class="notranslate"> java.lang.IllegalStateException: Recursive entry to executePendingTransactions
        at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1457)
        at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:482)
        at com.bumptech.glide.manager.RequestManagerRetriever.supportFragmentGet(RequestManagerRetriever.java:148)
        at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:66)
        at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:29)
        at com.bumptech.glide.Glide.with(Glide.java:537)
</code></pre></div>
<p dir="auto">A perfect example of this would be an <code class="notranslate">ViewPager</code> containing several Fragments that calls Glide at the very beginning of <code class="notranslate">onCreateView</code>.</p>
<p dir="auto">I have a customized ImageView which is using Glide to load up it's content during <code class="notranslate">onAttachedToWindow()</code>. It works correctly if it is embedded into an activity, however if I put it into a Fragment it fails.<br>
I use Glide with this two lines as recommended:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Glide.get(getContext()).register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(...));
Glide.with(getContext()).load(...).into(this);"><pre class="notranslate"><span class="pl-smi">Glide</span>.<span class="pl-en">get</span>(<span class="pl-en">getContext</span>()).<span class="pl-en">register</span>(<span class="pl-smi">GlideUrl</span>.<span class="pl-k">class</span>, <span class="pl-smi">InputStream</span>.<span class="pl-k">class</span>, <span class="pl-k">new</span> <span class="pl-smi">VolleyUrlLoader</span>.<span class="pl-smi">Factory</span>(...));
<span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-en">getContext</span>()).<span class="pl-en">load</span>(...).<span class="pl-en">into</span>(<span class="pl-smi">this</span>);</pre></div>
<p dir="auto">It fails on the second line, and note that in the Fragment's case, the getContext() is returning the FragmentActivity, not the Fragment. I'm guessing that this is the problem, which I might be able to circumvent with some hacking (by providing the Fragment to the view, which I don't really want to do).<br>
Anyway the resulting stack trace is the following:</p>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="FATAL EXCEPTION: main
java.lang.IllegalStateException: Recursive entry to executePendingTransactions
    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1456)
    at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:482)
    at com.bumptech.glide.manager.RequestManagerRetriever.supportFragmentGet(RequestManagerRetriever.java:148)
    at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:66)
    at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:29)
    at com.bumptech.glide.Glide.with(Glide.java:537)"><pre class="notranslate"><span class="pl-en">FATAL</span> <span class="pl-pds">EXCEPTION</span>: <span class="pl-en">main</span>
<span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">lang</span><span class="pl-kos">.</span><span class="pl-en">IllegalStateException</span>: <span class="pl-en">Recursive</span> <span class="pl-en">entry</span> <span class="pl-en">to</span> <span class="pl-en">executePendingTransactions</span>
    <span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">support</span><span class="pl-kos">.</span><span class="pl-en">v4</span><span class="pl-kos">.</span><span class="pl-en">app</span><span class="pl-kos">.</span><span class="pl-en">FragmentManagerImpl</span><span class="pl-kos">.</span><span class="pl-en">execPendingActions</span><span class="pl-kos">(</span><span class="pl-v">FragmentManager</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:1456</span><span class="pl-kos">)</span>
    <span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">support</span><span class="pl-kos">.</span><span class="pl-en">v4</span><span class="pl-kos">.</span><span class="pl-en">app</span><span class="pl-kos">.</span><span class="pl-en">FragmentManagerImpl</span><span class="pl-kos">.</span><span class="pl-en">executePendingTransactions</span><span class="pl-kos">(</span><span class="pl-v">FragmentManager</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:482</span><span class="pl-kos">)</span>
    <span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">manager</span><span class="pl-kos">.</span><span class="pl-en">RequestManagerRetriever</span><span class="pl-kos">.</span><span class="pl-en">supportFragmentGet</span><span class="pl-kos">(</span><span class="pl-v">RequestManagerRetriever</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:148</span><span class="pl-kos">)</span>
    <span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">manager</span><span class="pl-kos">.</span><span class="pl-en">RequestManagerRetriever</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-v">RequestManagerRetriever</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:66</span><span class="pl-kos">)</span>
    <span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">manager</span><span class="pl-kos">.</span><span class="pl-en">RequestManagerRetriever</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-v">RequestManagerRetriever</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:29</span><span class="pl-kos">)</span>
    <span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">Glide</span><span class="pl-kos">.</span><span class="pl-en">with</span><span class="pl-kos">(</span><span class="pl-v">Glide</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:537</span><span class="pl-kos">)</span></pre></div>