harani
چهارشنبه 29 آذر 1391, 19:38 عصر
سلام دوستان با توجه به کد پایین بگید که در قسمت
SimpleCursorAdapter notes = newSimpleCursorAdapter(this, R.layout.notes_row, mNotesCursor, from, to);//a
Context (که در اینجا this است) دقیقاً چی و به چه بدردی میخوره و کارش چی ؟؟؟؟ و
آرایه to به چه دردی میخوره و کارش چی ؟؟
privatevoidfillData() { //k
// Get all of the rows from the database and create the item list
Cursor mNotesCursor = mDbHelper.fetchAllNotes(); //f
startManagingCursor(mNotesCursor); //h
// Create an array to specify the fields we want to display in the list (only TITLE)
String[] from = newString[]{NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_BODY}; //d
// and an array of the fields we want to bind those fields to (in this case just text1)
int[] to = newint[]{R.id.text1, R.id.text2}; //c
// Now create a simple cursor adapter and set it to display
SimpleCursorAdapter notes =
newSimpleCursorAdapter(this, R.layout.notes_row, mNotesCursor, from, to); //b
setListAdapter(notes); //a
}
با سپاس از همگی
SimpleCursorAdapter notes = newSimpleCursorAdapter(this, R.layout.notes_row, mNotesCursor, from, to);//a
Context (که در اینجا this است) دقیقاً چی و به چه بدردی میخوره و کارش چی ؟؟؟؟ و
آرایه to به چه دردی میخوره و کارش چی ؟؟
privatevoidfillData() { //k
// Get all of the rows from the database and create the item list
Cursor mNotesCursor = mDbHelper.fetchAllNotes(); //f
startManagingCursor(mNotesCursor); //h
// Create an array to specify the fields we want to display in the list (only TITLE)
String[] from = newString[]{NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_BODY}; //d
// and an array of the fields we want to bind those fields to (in this case just text1)
int[] to = newint[]{R.id.text1, R.id.text2}; //c
// Now create a simple cursor adapter and set it to display
SimpleCursorAdapter notes =
newSimpleCursorAdapter(this, R.layout.notes_row, mNotesCursor, from, to); //b
setListAdapter(notes); //a
}
با سپاس از همگی