Trying to Implement Glide inside recyclerView App is crashing. Logcat saying
W/ResourceType: No package identifier when getting name for resource number 0x00000000
V/studio.deploy: Package broadcast exit hook { cmd=3, time=75125210000000, thread=2 }
Fixing application and activity contexts
W/ResourceType: No package identifier when getting name for resource number 0x00000000
E/RecyclerView: No adapter attached; skipping layout
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.tc, PID: 26232
java.lang.IllegalArgumentException: You must pass in a non null View
at com.bumptech.glide.GenericRequestBuilder.into(GenericRequestBuilder.java:685)
at com.bumptech.glide.DrawableRequestBuilder.into(DrawableRequestBuilder.java:457)
at com.example.tc.TCAdapter.onBindViewHolder(TCAdapter.java:44)
at com.example.tc.TCAdapter.onBindViewHolder(TCAdapter.java:22)
My Implementation code is
Glide.with( context ).load( tcImages.get( position ).getFullName() ).into( holder.imageView );
My full Adapter code is
public class TCAdapter extends RecyclerView.Adapter<TCAdapter.MyViewHolder> {
List<TCImages> tcImages;
Context context;
ImageView imageView;
public TCAdapter(List<TCImages> tcImages, Context context){
this.tcImages = tcImages;
this.context = context;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from( context );
View view = inflater.inflate( R.layout.item_tc_recycler, parent, false );
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
holder.textView.setText( tcImages.get( position ).getEmail() );
Glide.with( context ).load( tcImages.get( position ).getFullName() ).into( holder.imageView );
// Glide.with( context ).load( "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" ).into( holder.imageView );
// Toast.makeText(context, tcImages.get( position ).getFullName().toString(), Toast.LENGTH_LONG).show();
}
@Override
public int getItemCount() {
return tcImages.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
TextView textView;
ImageView imageView;
public MyViewHolder(@NonNull View itemView) {
super( itemView );
textView = (TextView) itemView.findViewById( R.id.txtItem );
imageView = (ImageView) itemView.findViewById( R.id.imageView );
}
}
}
Tried pasting direct string of image address even then it's crashing