[英]Custom CursorAdapter to bind to simple_list_item_checked
例如,假设我有一个待办事项的SQLite数据库,每个数据库都有一个字符串标题和一个完整的整数。 如何创建自定义适配器(扩展了CursorAdaper)以将android.R.layout.simple_list_item_checked
的复选框绑定到已完成的整数? 我已经知道我必须将整数转换为布尔值,我使用的是true = 1和false = 0。
请在您的适配器中重写bindView抽象方法。
/**
* Bind an existing view to the data pointed to by cursor
* @param view Existing view, returned earlier by newView
* @param context Interface to application's global information
* @param cursor The cursor from which to get the data. The cursor is already
* moved to the correct position.
*/
public abstract void bindView(View view, Context context, Cursor cursor);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.