android - setListAdapter multiple items? -
Is it possible that SimpleCursorAdapter recover many items and display them? This is from Android Notepad Tutorial (slightly edited) and when I call it ASCOresDbAdapter.KEY_COL2_NAME, ASKORADAPEATOR KEY_COL1_DATE then it only displays in TextView
Is there a reason for it or am I forgetting something?
Private Zero fillData () {// Get all notes from database and create item list cursor c = scoresDbAdapter.fetchAllNotes (); StartManagingCursor (c); String [] from = new string [] {ASCOresDbAdapter.KEY_COL2_NAME, AScoresDbAdapter.KEY_COL1_DATE}; Int for [] = new int [] {R.id.text1}; // Now create an array adapter and set it to display using our line SimpleCursorAdapter Notes = New SimpleCursorAdapter (this, R.layout.shots_row, c, from, to 0); SetListAdapter (Notes); }
OK, I think it has misled me earlier that array And it's probably putting a to with a int , so I added another TextView above and above:
string [] {ASCOresDbAdapter.KEY_COL1_DATE, ASCOresDbAdapter.KEY_COL2_NAME}; Int for [] = new int [] {R.id.text1, R.id.text2}; And now it's just [Date] or instead of [Name] instead of [Date] [Name] Displays
Not sure if this is correct, but if better, then I would be happy to find out.
Comments
Post a Comment