2010-12-20 2 views
0

예를 들어, todos의 SQLite 데이터베이스가 있고, 각각 문자열 제목과 정수가 완료되었다고 가정하십시오. android.R.layout.simple_list_item_checked의 체크 박스를 정수로 바인딩 할 수있는 맞춤형 어댑터 (CursorAdaper를 확장)를 어떻게 만들 수 있습니까? 정수를 부울로 변환해야한다는 것을 이미 알고 있습니다. 참 = 1 및 거짓 = 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

정확히 내가 필요한 것. –

관련 문제