Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 自定义游标用于绑定到简单\u列表\u项目的适配器\u已选中_Java_Android_Sqlite_Cursor - Fatal编程技术网

Java 自定义游标用于绑定到简单\u列表\u项目的适配器\u已选中

Java 自定义游标用于绑定到简单\u列表\u项目的适配器\u已选中,java,android,sqlite,cursor,Java,Android,Sqlite,Cursor,例如,假设我有一个包含TODO的SQLite数据库,每个数据库都有一个字符串标题和一个完整的整数。如何创建一个自定义适配器(扩展CursorAdaper),将android.R.layout.simple\u list\u item\u checked中的复选框绑定到已完成的整数?我已经知道必须将整数转换为布尔值,我使用的是true=1和false=0。请在适配器中重写bindView抽象方法 /** * Bind an existing view to the data pointed t

例如,假设我有一个包含TODO的SQLite数据库,每个数据库都有一个字符串标题和一个完整的整数。如何创建一个自定义适配器(扩展CursorAdaper),将
android.R.layout.simple\u list\u item\u 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);