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:

New code from
  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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -