I m在一份清单中工作,使用习惯资源中心,显示文稿和 Check。 文本意见书和Box从库尔斯里拿到。 我先问一下这个问题,最近的是,当我把一些浏览器从旧的文稿中抽出文字时,就选择了一些 Check子。 我增加了一个记录线,看看上去什么,这更使我感到困惑。
@Override
public void bindView(View v, Context ctx, Cursor c) {
ViewHolder holder = (ViewHolder)v。getTag();
holder。tv。setText(holder。tvText);
holder。cb。setChecked(holder。checked);
Log。d(TAG, "in bindView, rowId:" + holder。rowId + " Scripture:" + holder。tvText);
}
。
@Override
public View newView(Context ctx, Cursor c, ViewGroup vg){
View v = li。inflate(layout, vg, false);
ViewHolder holder;
holder = new ViewHolder();
holder。tv = (TextView)v。findViewById(to[0]);
holder。tvText = c。getString(c。getColumnIndex(from[0]));
holder。cb = (CheckBox)v。findViewById(to[1]);
holder。rowId = c。getLong(c。getColumnIndex(from[2]));
holder。checked = (c。getString(c。getColumnIndexOrThrow(from[1]))。equals("n")) ?
false : true;
holder。cb。setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
View rowView = ((View)v。getParent());
ViewHolder holder = (ViewHolder)rowView。getTag();
holder。checked = (holder。checked == false) ? true : false;
smDb。setMemorized(holder。rowId);
rowView。setTag(holder);
Log。d(TAG, "check box clicked: " + holder。rowId);
}});
Log。d(TAG, "in newView, rowId:" + holder。rowId);
v。setTag(holder);
return v;
}
。
static class ViewHolder {
TextView tv;
String tvText;
CheckBox cb;
boolean checked;
Long rowId;
}
后勤产出
in newView, rowId:26
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in newView, rowId:27
in bindView, rowId:27 Scripture:Matthew 6:24
in newView, rowId:28
in bindView, rowId:28 Scripture:Matthew 16:15-9
in newView, rowId:29
in bindView, rowId:29 Scripture:Matthew 25:40
in newView, rowId:30
in bindView, rowId:30 Scripture:Luke 24:36-9
in newView, rowId:31
in bindView, rowId:31 Scripture:John 3:5
in newView, rowId:32
in bindView, rowId:32 Scripture:John 7:17
in newView, rowId:33
in bindView, rowId:33 Scripture:John 10:16
in newView, rowId:34
in bindView, rowId:34 Scripture:John 14:15
in newView, rowId:26
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6
in bindView, rowId:26 Scripture:Matthew 5:14-6