jms_gears1
Lurker
Ive been playing around with the notepad tutorial on the http://www.developer.android.com. Most of it i understand, well from the notepadv1 class, the only thing im really having trouble with is fillData().
the code is:
so from going over that code sample the only thing i can figure out a cursor to be is another name for a table.
P.S. In case you didnt already figure it out, the comments are my thoughts or what i can figure out about the line of code.
the code is:
Code:
private void fillData() {
//I understand that this gets all the notes and stores it in a cursor my main problem is i dont really understand what a cursor is
mNotesCursor = mDbHelper.fetchAllNotes();
//Since i dont know what a cursor is i have no idea what this does other than starts to manage this mysterious cursor
startManagingCursor(mNotesCursor);
//only thing i can seem to figure out about this line is that it puts the key for the title of the note into a string array, though i have no idea why
String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
//this looks like it does the same thing as above but it puts the value for text1 into an int array, again not sure why.
int[] to = new int[]{R.id.text1};
//these last two lines i have no clue at all whats going on here
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.notes_row, mNotesCursor, from, to);
setListAdapter(notes);
}
so from going over that code sample the only thing i can figure out a cursor to be is another name for a table.
P.S. In case you didnt already figure it out, the comments are my thoughts or what i can figure out about the line of code.