Насколько я понимаю, один из конструкторов SimpleCursorAdapter устарел. Следующий конструктор является правильным для использования:
SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags)
Может кто-нибудь объяснить мне, что это за последний параметр и что я должен туда поместить?
У меня есть метод, который использует SimpleCursorAdapter и заполняет файл пользовательского макета данными:
public void populateListView(){
Cursor cursor = myDB.getAllRows();
String[] fromFieldNames = new String[] {DBAdapter.KEY_NAME,DBAdapter.KEY_NUMBER,DBAdapter.KEY_EMAIL};
int[] toViewIDs = new int[] {R.id.customRowContactName,R.id.customRowContactNumber,R.id.customRowRowEmail};
SimpleCursorAdapter cursorAdapter;
cursorAdapter = new SimpleCursorAdapter(getActivity(),R.layout.contacts_custom_row,cursor,fromFieldNames,toViewIDs,WHAT DO I PLACE HERE);
myList = (ListView)view.findViewById(R.id.listViewFragment);
myList.setAdapter(cursorAdapter);
}
Я пока поставил 1, чтобы избавиться от синтаксической ошибки, но не уверен, как это повлияет на мою программу.