I have an issue using a viewGroup
, for some reason the id
doesn't process the statement, and really I tried everything, can you help please?
I don't know if it is something about the version3.3.2
or what's wrong with the code
public class popularAdapter extends RecyclerView.Adapter<popularAdapter.ImageViewHolder> {
private Context mContext;
private List<popular> mPopulars;
public popularAdapter (Context context,List<popular>populars){
mContext=context;
mPopulars=populars;
}
@Override
public ImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//HERE IS THE ISSUE
View v= LayoutInflater.from(mContext).inflate(R.layout.popular_item2,viewGroup,false);
return new ImageViewHolder(v);
}
@Override
public void onBindViewHolder(ImageViewHolder holder, int position) {
popular popularCur=mPopulars.get(position);
ImageViewHolder.prodName.setText(popularCur.getProduc_name());
}
@Override
public int getItemCount() {
return 0;
}
public class ImageViewHolder extends RecyclerView.ViewHolder {
public TextView prd_name;
public TextView prd_price;
public TextView prd_img;
public ImageViewHolder(View itemView) {
super(itemView);
prd_name =itemView.findViewById(R.id.prodName);
prd_price=itemView.findViewById(R.id.prodPrice);
prd_img =itemView.findViewById(R.id.prodImageHolder);
}
}
}