2010-12-20 8 views
0

例えば、私はtodosのSQLiteデータベースを持っていて、それぞれが文字列のタイトルと整数が入力されているとします。 android.R.layout.simple_list_item_checkedのチェックボックスを整数に変換するカスタムアダプタ(CursorAdaperを拡張)を作成するにはどうしたらいいですか?私はすでに整数をブール値に変換する必要があることを知っています。私はtrue = 1とfalse = 0を使用しています。simple_list_item_checkedにバインドするカスタムCursorAdapter

答えて

1

アダプタで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); 
+0

正確に必要なもの。 –

関連する問題