Glide error when loading a recyclerView "You must pass in a non null View"
<p>Hi I am trying to populate a Grid RecyclerView with a series of Images.
To do that I fetch image urls from the web and load them into a List&lt;>. The problem is that apparently the ImageView reference that the adapter gets is null. This is the code:</p>

<pre><code>private class ShowHolder extends RecyclerView.ViewHolder {
        public ImageView mImageView;
        public ProgressBar progressBar;

        public ShowHolder(LayoutInflater inflater, ViewGroup container) {
            super(inflater.inflate(R.layout.list_item_row, container, false));
            mImageView = (ImageView) itemView.findViewById(R.id.imageView);
            progressBar = (ProgressBar) itemView.findViewById(R.id.progress);
        }
    }

    private class ShowAdapter extends RecyclerView.Adapter&lt;ShowHolder&gt; {
        private List&lt;Show&gt; mShows;

        public ShowAdapter(List&lt;Show&gt; shows) {
            mShows = shows;
        }

        @Override
        public ShowHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
            return new ShowHolder(layoutInflater, parent);
        }
        @Override
        public void onBindViewHolder(ShowHolder holder, int position) {
            Show currentShow = mShows.get(position);




            Glide.with(getActivity())
                    .load(currentShow.getImage()) //image url
                    .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) {
                                            holder.progressBar.setVisibility(View.GONE);
                            return false;
                        }
                    })
                    .into(holder.mImageView); //error here

        }
        @Override
        public int getItemCount() {
            return mShows.size();
        }
    }
</code></pre>

<p>This is how I pass the image urls to the adapter:</p>

<pre><code>@Override
    public void onLoadFinished(Loader&lt;List&lt;Show&gt;&gt; loader, List&lt;Show&gt; shows) {
        // Clear the adapter of previous earthquake data
        mShowAdapter = new ShowAdapter(null);
        mShowAdapter.notifyDataSetChanged();

        // If there is a valid list of Shows, then add them to the adapter's
        // data set. This will trigger the ListView to update.
        Log.v(LOG_TAG, "onLoadFinished@shows: " + shows);
        if (shows != null &amp;&amp; !shows.isEmpty()) {
            mShowAdapter = new ShowAdapter(shows);
            mShowAdapter.notifyDataSetChanged();
            mRecyclerView.setAdapter(mShowAdapter);
        }

        pb.setVisibility(View.GONE);
    }
</code></pre>

<p>Stacktrace:</p>

<pre><code>FATAL EXCEPTION: main
                                                               Process: com.dcs.shows, PID: 27818
                                                               java.lang.IllegalArgumentException: You must pass in a non null View
                                                                   at com.bumptech.glide.GenericRequestBuilder.into(GenericRequestBuilder.java:678)
                                                                   at com.bumptech.glide.DrawableRequestBuilder.into(DrawableRequestBuilder.java:448)
                                                                   at com.dcs.shows.ListFragment$ShowAdapter.onBindViewHolder(ListFragment.java:154)
                                                                   at com.dcs.shows.ListFragment$ShowAdapter.onBindViewHolder(ListFragment.java:118)
                                                                   at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:5768)
                                                                   at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:5801)
                                                                   at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5037)
                                                                   at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4913)
                                                                   at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2029)
                                                                   at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:531)
                                                                   at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
                                                                   at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
                                                                   at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
                                                                   at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3260)
                                                                   at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3069)
                                                                   at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3518)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
                                                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
                                                                   at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
                                                                   at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1319)
                                                                   at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:817)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1191)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
                                                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
                                                                   at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
                                                                   at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
                                                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
                                                                   at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
                                                                   at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
                                                                   at android.view.View.layout(View.java:16630)
                                                                   at android.view.ViewGroup.layout(ViewGroup.java:5437)
                                                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
                                                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
                                                                   at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
                                                                   at android.view.View.layout(View.java:16630)
</code></pre>

<p>Thanks</p>