这是我的代码:
@Override
public void onBindViewHolder(ViewHolder holder, int position){
Glide.with(context)
.load("http://192.168.60.37/signalss/image/" + list_data.get(position).get("Icon"))
.crossFade()
.placeholder(R.mipmap.ic_launcher)
.into(holder.imgsignals);
holder.txtsignals1.setText(list_data.get(position).get("SignalsId"));
holder.txtsignals2.setText(list_data.get(position).get("PairName"));
holder.txtsignals3.setText(list_data.get(position).get("SignalsPosition"));
holder.txtsignals4.setText(list_data.get(position).get("AreaOpenPrice1"));
holder.txtsignals5.setText(list_data.get(position).get("AreaOpenPrice2"));
holder.txtsignals6.setText(list_data.get(position).get("StopLoss"));
holder.txtsignals7.setText(list_data.get(position).get("TargetProfit1"));
holder.txtsignals8.setText(list_data.get(position).get("TargetProfit3"));
holder.txtsignals9.setText(list_data.get(position).get("AddDate"));
}
我想将此更改为“买入或卖出”。
我想用ifelse
,但是怎么用?
答案 0 :(得分:0)
您可以将textText设置如下:holder.txtsignals1.setText((list_data.get(position).get("SignalsId").equals("B") ? "BUY" : "SELL");