我很难弄清楚如何使用 if/else 语句比较两个价格以确定哪个价格较大,哪个价格较小。通过使用箭头来表示它
错误:double 不能取消引用
就目前而言,每当我编译我的代码时,我都会收到此错误:
public class MeetAdapter extends RecyclerView.Adapter<MeetAdapter.ProductViewHolder> {
private Context mCtx;
private List<Meet> meetList;
public MeetAdapter(Context mCtx, List<Meet> meetList) {
this.mCtx = mCtx;
this.meetList = meetList;
}
@Override
public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(mCtx);
View view = inflater.inflate(R.layout.meat_list_row, null);
return new ProductViewHolder(view);
}
@Override
public void onBindViewHolder(ProductViewHolder holder, int position) {
Meet meet = meetList.get(position);
Picasso.with(mCtx)
.load(meet.getUrl_id())
.into(holder.imageViewM);
holder.textViewName.setText(meet.getName());
holder.newPrice.setText(String.valueOf(meet.getPrice()));
holder.old_price.setText(meet.getOld_price());
holder.textViewDate_id.setText(meet.getDate_id());
}
@Override
public int getItemCount() {
return meetList.size();
}
class ProductViewHolder extends RecyclerView.ViewHolder {
TextView textViewName, old_price, newPrice, textViewDate_id;
ImageView imageViewM, imageViewD;
public ProductViewHolder(View itemView) {
super(itemView);
textViewName = itemView.findViewById(R.id.meat_name);
//old_price = itemView.findViewById(R.id.meat_Direction);
newPrice = itemView.findViewById(R.id.meat_price);
textViewDate_id = itemView.findViewById(R.id.meat_date);
imageViewM = itemView.findViewById(R.id.image_meat);
}
}
}
}
素胚勾勒不出你
相关分类