Skip to content Skip to sidebar Skip to footer

Glide Error When Loading A RecyclerView "You Must Pass In A Non Null View"

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<>. The problem is that apparently

Solution 1:

Change your onCerateViewHolder method to:

    @Override
    public ShowHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            LayoutInflater inflater = LayoutInflater.from(getActivity());
            View rootView = inflater.inflate(R.layout.list_item_row, parent, false);
            return new ShowHolder(rootView);
    }

And change your holder constructor to:

   public ShowHolder(View itemView) {
            super(itemView);
            mImageView = (ImageView) itemView.findViewById(R.id.imageView);
            progressBar = (ProgressBar) itemView.findViewById(R.id.progress);
   }

Post a Comment for "Glide Error When Loading A RecyclerView "You Must Pass In A Non Null View""