<p dir="auto">glide:4.0.0-SNAPSHOT<br>
It's neither device nor Android version specific. I can't reproduce it, but it doesn't seem rare when looking at crash numbers.<br>
In this case it happened when returning from Activity A to Activity B and Activity B contains the animation. It possible that the ImageViews visibility state is changed shortly after returning to Activity B.</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" public void setState(State state) {
        mState = state;
        if (state == State.WORKING) {
            setVisibility(VISIBLE);
            mIntroContainer.setVisibility(GONE);
            mEmptyContainer.setVisibility(GONE);
            mWorkingContainer.setVisibility(VISIBLE); //  android:id=&quot;@+id/working_overlay&quot;
            Glide.with(getContext())
                    .load(COFFEE_ANIM_ASSET)
                    .apply(RequestOptions.formatOf(DecodeFormat.PREFER_RGB_565))
                    .apply(RequestOptions.placeholderOf(R.drawable.sdmanimation))
                    .into(mWorkingAnimation); // android:id=&quot;@+id/iv_working_animation&quot;
        } else {
            Glide.with(getContext()).clear(mWorkingAnimation);
            mWorkingContainer.setVisibility(GONE);
            if (state == State.INTRO) {
                setVisibility(VISIBLE);
                mEmptyContainer.setVisibility(GONE);
                mIntroContainer.setVisibility(VISIBLE);
            } else if (state == State.NORESULTS) {
                setVisibility(VISIBLE);
                mIntroContainer.setVisibility(GONE);
                mEmptyContainer.setVisibility(VISIBLE);
            } else if (state == State.GONE) {
                setVisibility(GONE);
                mIntroContainer.setVisibility(GONE);
                mEmptyContainer.setVisibility(GONE);
            }
        }
    }"><pre class="notranslate"> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-s1">setState</span>(<span class="pl-smi">State</span> <span class="pl-s1">state</span>) {
        <span class="pl-s1">mState</span> = <span class="pl-s1">state</span>;
        <span class="pl-k">if</span> (<span class="pl-s1">state</span> == <span class="pl-smi">State</span>.<span class="pl-c1">WORKING</span>) {
            <span class="pl-en">setVisibility</span>(<span class="pl-c1">VISIBLE</span>);
            <span class="pl-s1">mIntroContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
            <span class="pl-s1">mEmptyContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
            <span class="pl-s1">mWorkingContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">VISIBLE</span>); <span class="pl-c">//  android:id="@+id/working_overlay"</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-c1">COFFEE_ANIM_ASSET</span>)
                    .<span class="pl-en">apply</span>(<span class="pl-smi">RequestOptions</span>.<span class="pl-en">formatOf</span>(<span class="pl-smi">DecodeFormat</span>.<span class="pl-c1">PREFER_RGB_565</span>))
                    .<span class="pl-en">apply</span>(<span class="pl-smi">RequestOptions</span>.<span class="pl-en">placeholderOf</span>(<span class="pl-smi">R</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">sdmanimation</span>))
                    .<span class="pl-en">into</span>(<span class="pl-s1">mWorkingAnimation</span>); <span class="pl-c">// android:id="@+id/iv_working_animation"</span>
        } <span class="pl-k">else</span> {
            <span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-en">getContext</span>()).<span class="pl-en">clear</span>(<span class="pl-s1">mWorkingAnimation</span>);
            <span class="pl-s1">mWorkingContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
            <span class="pl-k">if</span> (<span class="pl-s1">state</span> == <span class="pl-smi">State</span>.<span class="pl-c1">INTRO</span>) {
                <span class="pl-en">setVisibility</span>(<span class="pl-c1">VISIBLE</span>);
                <span class="pl-s1">mEmptyContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
                <span class="pl-s1">mIntroContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">VISIBLE</span>);
            } <span class="pl-k">else</span> <span class="pl-k">if</span> (<span class="pl-s1">state</span> == <span class="pl-smi">State</span>.<span class="pl-c1">NORESULTS</span>) {
                <span class="pl-en">setVisibility</span>(<span class="pl-c1">VISIBLE</span>);
                <span class="pl-s1">mIntroContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
                <span class="pl-s1">mEmptyContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">VISIBLE</span>);
            } <span class="pl-k">else</span> <span class="pl-k">if</span> (<span class="pl-s1">state</span> == <span class="pl-smi">State</span>.<span class="pl-c1">GONE</span>) {
                <span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
                <span class="pl-s1">mIntroContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
                <span class="pl-s1">mEmptyContainer</span>.<span class="pl-en">setVisibility</span>(<span class="pl-c1">GONE</span>);
            }
        }
    }</pre></div>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    &lt;LinearLayout
        android:id=&quot;@+id/working_overlay&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;match_parent&quot;
        android:layout_gravity=&quot;center&quot;
        android:gravity=&quot;center&quot;
        android:orientation=&quot;vertical&quot;
        android:padding=&quot;16dp&quot;
        android:visibility=&quot;gone&quot;
        tools:visibility=&quot;visible&quot;&gt;

        &lt;ImageView
            android:id=&quot;@+id/iv_working_animation&quot;
            android:layout_width=&quot;200dp&quot;
            android:layout_height=&quot;200dp&quot;
            android:padding=&quot;5dp&quot;
            android:src=&quot;@drawable/sdmanimation&quot;/&gt;
    &lt;/LinearLayout&gt;"><pre class="notranslate">    &lt;<span class="pl-ent">LinearLayout</span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/working_overlay<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">orientation</span>=<span class="pl-s"><span class="pl-pds">"</span>vertical<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">padding</span>=<span class="pl-s"><span class="pl-pds">"</span>16dp<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">visibility</span>=<span class="pl-s"><span class="pl-pds">"</span>gone<span class="pl-pds">"</span></span>
        <span class="pl-e">tools</span><span class="pl-e">:</span><span class="pl-e">visibility</span>=<span class="pl-s"><span class="pl-pds">"</span>visible<span class="pl-pds">"</span></span>&gt;

        &lt;<span class="pl-ent">ImageView</span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/iv_working_animation<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>200dp<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>200dp<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">padding</span>=<span class="pl-s"><span class="pl-pds">"</span>5dp<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">"</span>@drawable/sdmanimation<span class="pl-pds">"</span></span>/&gt;
    &lt;/<span class="pl-ent">LinearLayout</span>&gt;</pre></div>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.bumptech.glide.gifdecoder.GifHeader.frameCount' on a null object reference
at com.bumptech.glide.gifdecoder.GifDecoder.getFrameCount(GifDecoder.java:262)
at com.bumptech.glide.load.resource.gif.GifFrameLoader.getFrameCount(GifFrameLoader.java:139)
at com.bumptech.glide.load.resource.gif.GifDrawable.startRunning(GifDrawable.java:166)
at com.bumptech.glide.load.resource.gif.GifDrawable.start(GifDrawable.java:154)
at com.bumptech.glide.request.target.ImageViewTarget.onStart(ImageViewTarget.java:102)
at com.bumptech.glide.manager.TargetTracker.onStart(TargetTracker.java:31)
at com.bumptech.glide.RequestManager.onStart(RequestManager.java:245)
at com.bumptech.glide.manager.ActivityFragmentLifecycle.onStart(ActivityFragmentLifecycle.java:51)
at com.bumptech.glide.manager.SupportRequestManagerFragment.onStart(SupportRequestManagerFragment.java:175)
at android.support.v4.app.Fragment.performStart(Fragment.java:1986)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1102)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1230)
at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:2047)
at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:176)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:553)
at eu.thedarken.sdm.SDMServiceActivity.onStart(SDMServiceActivity.java:79)
at eu.thedarken.sdm.SDMMainActivity.onStart(SDMMainActivity.java:155)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)
at android.app.Activity.performStart(Activity.java:6006)
at android.app.Activity.performRestart(Activity.java:6063)
at android.app.Activity.performResume(Activity.java:6068)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2975)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5254) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) "><pre class="notranslate"><span class="pl-en">Caused</span> <span class="pl-pds">by</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-v">NullPointerException</span>: <span class="pl-v">Attempt</span> <span class="pl-en">to</span> <span class="pl-en">read</span> <span class="pl-en">from</span> <span class="pl-en">field</span> <span class="pl-s">'int com.bumptech.glide.gifdecoder.GifHeader.frameCount'</span> <span class="pl-en">on</span> <span class="pl-en">a</span> <span class="pl-en">null</span> <span class="pl-en">object</span> <span class="pl-en">reference</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">gifdecoder</span><span class="pl-kos">.</span><span class="pl-en">GifDecoder</span><span class="pl-kos">.</span><span class="pl-en">getFrameCount</span><span class="pl-kos">(</span><span class="pl-v">GifDecoder</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:262</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">load</span><span class="pl-kos">.</span><span class="pl-en">resource</span><span class="pl-kos">.</span><span class="pl-en">gif</span><span class="pl-kos">.</span><span class="pl-en">GifFrameLoader</span><span class="pl-kos">.</span><span class="pl-en">getFrameCount</span><span class="pl-kos">(</span><span class="pl-v">GifFrameLoader</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:139</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">load</span><span class="pl-kos">.</span><span class="pl-en">resource</span><span class="pl-kos">.</span><span class="pl-en">gif</span><span class="pl-kos">.</span><span class="pl-en">GifDrawable</span><span class="pl-kos">.</span><span class="pl-en">startRunning</span><span class="pl-kos">(</span><span class="pl-v">GifDrawable</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:166</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">load</span><span class="pl-kos">.</span><span class="pl-en">resource</span><span class="pl-kos">.</span><span class="pl-en">gif</span><span class="pl-kos">.</span><span class="pl-en">GifDrawable</span><span class="pl-kos">.</span><span class="pl-en">start</span><span class="pl-kos">(</span><span class="pl-v">GifDrawable</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:154</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">request</span><span class="pl-kos">.</span><span class="pl-en">target</span><span class="pl-kos">.</span><span class="pl-en">ImageViewTarget</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">ImageViewTarget</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:102</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">TargetTracker</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">TargetTracker</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:31</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">RequestManager</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">RequestManager</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:245</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">ActivityFragmentLifecycle</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">ActivityFragmentLifecycle</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:51</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">SupportRequestManagerFragment</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">SupportRequestManagerFragment</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:175</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">Fragment</span><span class="pl-kos">.</span><span class="pl-en">performStart</span><span class="pl-kos">(</span><span class="pl-v">Fragment</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:1986</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">moveToState</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">:1102</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">moveToState</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">:1248</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">moveToState</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">:1230</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">dispatchStart</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">:2047</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">FragmentController</span><span class="pl-kos">.</span><span class="pl-en">dispatchStart</span><span class="pl-kos">(</span><span class="pl-v">FragmentController</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:176</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">FragmentActivity</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">FragmentActivity</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:553</span><span class="pl-kos">)</span>
<span class="pl-en">at</span> <span class="pl-en">eu</span><span class="pl-kos">.</span><span class="pl-en">thedarken</span><span class="pl-kos">.</span><span class="pl-en">sdm</span><span class="pl-kos">.</span><span class="pl-en">SDMServiceActivity</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">SDMServiceActivity</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:79</span><span class="pl-kos">)</span>
<span class="pl-en">at</span> <span class="pl-en">eu</span><span class="pl-kos">.</span><span class="pl-en">thedarken</span><span class="pl-kos">.</span><span class="pl-en">sdm</span><span class="pl-kos">.</span><span class="pl-en">SDMMainActivity</span><span class="pl-kos">.</span><span class="pl-en">onStart</span><span class="pl-kos">(</span><span class="pl-v">SDMMainActivity</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:155</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">app</span><span class="pl-kos">.</span><span class="pl-en">Instrumentation</span><span class="pl-kos">.</span><span class="pl-en">callActivityOnStart</span><span class="pl-kos">(</span><span class="pl-v">Instrumentation</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:1236</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">app</span><span class="pl-kos">.</span><span class="pl-en">Activity</span><span class="pl-kos">.</span><span class="pl-en">performStart</span><span class="pl-kos">(</span><span class="pl-v">Activity</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:6006</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">app</span><span class="pl-kos">.</span><span class="pl-en">Activity</span><span class="pl-kos">.</span><span class="pl-en">performRestart</span><span class="pl-kos">(</span><span class="pl-v">Activity</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:6063</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">app</span><span class="pl-kos">.</span><span class="pl-en">Activity</span><span class="pl-kos">.</span><span class="pl-en">performResume</span><span class="pl-kos">(</span><span class="pl-v">Activity</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:6068</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">app</span><span class="pl-kos">.</span><span class="pl-en">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">performResumeActivity</span><span class="pl-kos">(</span><span class="pl-v">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:2975</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">app</span><span class="pl-kos">.</span><span class="pl-en">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">handleResumeActivity</span><span class="pl-kos">(</span><span class="pl-v">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:3017</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">app</span><span class="pl-kos">.</span><span class="pl-en">ActivityThread</span>$H<span class="pl-kos">.</span><span class="pl-en">handleMessage</span><span class="pl-kos">(</span><span class="pl-v">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:1347</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">os</span><span class="pl-kos">.</span><span class="pl-en">Handler</span><span class="pl-kos">.</span><span class="pl-en">dispatchMessage</span><span class="pl-kos">(</span><span class="pl-v">Handler</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:102</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">os</span><span class="pl-kos">.</span><span class="pl-en">Looper</span><span class="pl-kos">.</span><span class="pl-en">loop</span><span class="pl-kos">(</span><span class="pl-v">Looper</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:135</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">app</span><span class="pl-kos">.</span><span class="pl-en">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-v">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:5254</span><span class="pl-kos">)</span> 
<span class="pl-en">at</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">reflect</span><span class="pl-kos">.</span><span class="pl-en">Method</span><span class="pl-kos">.</span><span class="pl-en">invoke</span><span class="pl-kos">(</span><span class="pl-en">Native</span> <span class="pl-v">Method</span><span class="pl-kos">)</span> 
<span class="pl-en">at</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">reflect</span><span class="pl-kos">.</span><span class="pl-en">Method</span><span class="pl-kos">.</span><span class="pl-en">invoke</span><span class="pl-kos">(</span><span class="pl-v">Method</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:372</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">android</span><span class="pl-kos">.</span><span class="pl-en">internal</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">ZygoteInit</span>$MethodAndArgsCaller<span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-v">ZygoteInit</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:903</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">android</span><span class="pl-kos">.</span><span class="pl-en">internal</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">ZygoteInit</span><span class="pl-kos">.</span><span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-v">ZygoteInit</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:698</span><span class="pl-kos">)</span> </pre></div>
<p dir="auto">v 4.4.0</p>
<p dir="auto">N/A</p>
<p dir="auto">LG K10 Android M</p>
<p dir="auto">When adding new item in my RecyclerView I place it at the very top of the list (index 0). In my first attempt to add new items everything is good but in my second attempt to add new item I get some image to my CardView although I dont have any image include on that item. I also call notifyDataSetChanged() after adding new item at the top so that adapter position is always up to date.<br>
This is what on my RecyclerView.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    //Set all announcement data
     void setAnnouncementPost(final String su, final String title, final String description, final String 
     time, final String thumbnail, final String imgUri, final String imgThumbnail){
         //Stop shimmering the item if any of the data becomes available
         if (!su.isEmpty()) {
             new Handler().postDelayed(new Runnable() {
                 @Override
                 public void run() {

                     shimmerPost.stopShimmerAnimation();
                     mSuDP.setEnabled(true);
                     mSU.setBackground(null);
                     mSU.setText(su);
                     mSU.setTextColor(Color.WHITE);

                     post.setBackground(null);
                     post.setTextColor(Color.WHITE);

                     mtimePostedTxtView.setBackground(null);
                     mtimePostedTxtView.setText(time);
                     mtimePostedTxtView.setTextColor(Color.WHITE);

                     mtitleTxtView.setBackground(null);
                     mtitleTxtView.setText(title);
                     mtitleTxtView.setTextColor(Color.WHITE);

                     mdescriptionTxtView.setBackground(null);
                     mdescriptionTxtView.setText(description);
                     mdescriptionTxtView.setTextColor(Color.WHITE);

                     /*
                     Set post images
                     */

                     //Set the user's profile picture
                        if (!isDetached &amp;&amp; context != null)
                         GlideApp.with(context)
                                 .load(thumbnail)
                                 .placeholder(R.color.icon_not_selected)
                                 .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                                 .listener(new RequestListener&lt;Drawable&gt;() {
                                     @Override
                                     public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                                     Target&lt;Drawable&gt; target, boolean isFirstResource) {
                                         return false;
                                     }

                                     @Override
                                     public boolean onResourceReady(Drawable resource, Object model, 
                                     Target&lt;Drawable&gt; target, DataSource dataSource, boolean isFirstResource) {
                                         return false;
                                     }
                                 })
                                 .into(mSuDP);

                     //Check if user includes some photo
                     if (imgThumbnail != null &amp;&amp; imgUri != null){
                         mRelative.setVisibility(View.VISIBLE);
                         //Set any announcement picture
                         if (!isDetached)
                             if (imgThumbnail.contains(&quot;.jpg&quot;) &amp;&amp; imgUri.contains(&quot;.jpg&quot;))
                                 GlideApp.with(context)
                                         .load(imgUri)
                                         .thumbnail(GlideApp.with(context).load(imgThumbnail))
                                         .placeholder(R.color.icon_not_selected)
                                         .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                                         .listener(new RequestListener&lt;Drawable&gt;() {
                                             @Override
                                             public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                                             Target&lt;Drawable&gt; target, boolean isFirstResource) {
                                                 //If Log In forms is hidden then Progress should be visible
                                                 return false;
                                             }

                                             @Override
                                             public boolean onResourceReady(Drawable resource, Object model, 
                                             Target&lt;Drawable&gt; target, DataSource dataSource, boolean 
                                               isFirstResource) {
                                                 mProgress.setVisibility(View.GONE);
                                                 return false;
                                             }
                                         })
                                         .into(mImage);
                     }

                     else if (imgUri != null &amp;&amp; imgUri.contains(&quot;.gif&quot;)){
                         mRelative.setVisibility(View.VISIBLE);
                         //Set any announcement picture
                         if (!isDetached)
                             GlideApp.with(context)
                                     .asGif()
                                     .load(imgUri)
                                     .placeholder(R.color.icon_not_selected)
                                     .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                                     .listener(new RequestListener&lt;GifDrawable&gt;() {
                                         @Override
                                         public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                                            Target&lt;GifDrawable&gt; target, boolean isFirstResource) {
                                             return false;
                                         }

                                         @Override
                                         public boolean onResourceReady(GifDrawable resource, Object model, 
                                     Target&lt;GifDrawable&gt; target, DataSource dataSource, boolean isFirstResource) {
                                             mProgress.setVisibility(View.GONE);
                                             return false;
                                         }
                                     })
                                     .into(mImage);

                     }

             
                     leftBmb.setVisibility(View.VISIBLE);
                     mReactions.setVisibility(View.VISIBLE);

                 }
             },2000);
         }
     }"><pre class="notranslate"><code class="notranslate">    //Set all announcement data
     void setAnnouncementPost(final String su, final String title, final String description, final String 
     time, final String thumbnail, final String imgUri, final String imgThumbnail){
         //Stop shimmering the item if any of the data becomes available
         if (!su.isEmpty()) {
             new Handler().postDelayed(new Runnable() {
                 @Override
                 public void run() {

                     shimmerPost.stopShimmerAnimation();
                     mSuDP.setEnabled(true);
                     mSU.setBackground(null);
                     mSU.setText(su);
                     mSU.setTextColor(Color.WHITE);

                     post.setBackground(null);
                     post.setTextColor(Color.WHITE);

                     mtimePostedTxtView.setBackground(null);
                     mtimePostedTxtView.setText(time);
                     mtimePostedTxtView.setTextColor(Color.WHITE);

                     mtitleTxtView.setBackground(null);
                     mtitleTxtView.setText(title);
                     mtitleTxtView.setTextColor(Color.WHITE);

                     mdescriptionTxtView.setBackground(null);
                     mdescriptionTxtView.setText(description);
                     mdescriptionTxtView.setTextColor(Color.WHITE);

                     /*
                     Set post images
                     */

                     //Set the user's profile picture
                        if (!isDetached &amp;&amp; context != null)
                         GlideApp.with(context)
                                 .load(thumbnail)
                                 .placeholder(R.color.icon_not_selected)
                                 .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                                 .listener(new RequestListener&lt;Drawable&gt;() {
                                     @Override
                                     public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                                     Target&lt;Drawable&gt; target, boolean isFirstResource) {
                                         return false;
                                     }

                                     @Override
                                     public boolean onResourceReady(Drawable resource, Object model, 
                                     Target&lt;Drawable&gt; target, DataSource dataSource, boolean isFirstResource) {
                                         return false;
                                     }
                                 })
                                 .into(mSuDP);

                     //Check if user includes some photo
                     if (imgThumbnail != null &amp;&amp; imgUri != null){
                         mRelative.setVisibility(View.VISIBLE);
                         //Set any announcement picture
                         if (!isDetached)
                             if (imgThumbnail.contains(".jpg") &amp;&amp; imgUri.contains(".jpg"))
                                 GlideApp.with(context)
                                         .load(imgUri)
                                         .thumbnail(GlideApp.with(context).load(imgThumbnail))
                                         .placeholder(R.color.icon_not_selected)
                                         .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                                         .listener(new RequestListener&lt;Drawable&gt;() {
                                             @Override
                                             public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                                             Target&lt;Drawable&gt; target, boolean isFirstResource) {
                                                 //If Log In forms is hidden then Progress should be visible
                                                 return false;
                                             }

                                             @Override
                                             public boolean onResourceReady(Drawable resource, Object model, 
                                             Target&lt;Drawable&gt; target, DataSource dataSource, boolean 
                                               isFirstResource) {
                                                 mProgress.setVisibility(View.GONE);
                                                 return false;
                                             }
                                         })
                                         .into(mImage);
                     }

                     else if (imgUri != null &amp;&amp; imgUri.contains(".gif")){
                         mRelative.setVisibility(View.VISIBLE);
                         //Set any announcement picture
                         if (!isDetached)
                             GlideApp.with(context)
                                     .asGif()
                                     .load(imgUri)
                                     .placeholder(R.color.icon_not_selected)
                                     .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                                     .listener(new RequestListener&lt;GifDrawable&gt;() {
                                         @Override
                                         public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                                            Target&lt;GifDrawable&gt; target, boolean isFirstResource) {
                                             return false;
                                         }

                                         @Override
                                         public boolean onResourceReady(GifDrawable resource, Object model, 
                                     Target&lt;GifDrawable&gt; target, DataSource dataSource, boolean isFirstResource) {
                                             mProgress.setVisibility(View.GONE);
                                             return false;
                                         }
                                     })
                                     .into(mImage);

                     }

             
                     leftBmb.setVisibility(View.VISIBLE);
                     mReactions.setVisibility(View.VISIBLE);

                 }
             },2000);
         }
     }
</code></pre></div>
<p dir="auto">I think the main causes would be "notifyDataSetChanged()" since it give RecyclerView.NO_POSITION in every call. Also I get repetitive "Bitmap may cause graphical corruption!" logs if the item loaded asGif() is at the bottom or not yet visible on the screen but when it is visible it stop throwing logs and again if I scroll where it is no longer visible it throws again those message in logs.</p>