BindView 标记随机行。我试图检查数据的值并且 if 语句工作正常。我要做的就是当数据库中的完成字母='T'时出现(设置为可见)的图像。那么为什么要标记随机线呢?
dataAdapter = new SimpleCursorAdapter(
this,
R.layout.component_details,
null,
columns,
to,
0){
@Override
public void bindView(View view, Context context, Cursor cursor) {
super.bindView(view, context, cursor);
View completed = findViewById(R.id.txt_completed);
String completedColumn = cursor.getString(cursor.getColumnIndex(Db.COLUMN_COMPLETED));
ImageView imgview = (ImageView)view.findViewById(R.id.icon_check);
if(completedColumn.equals("T")){
imgview.setVisibility(View.VISIBLE);
}
}
};