2010年4月29日星期四

multi-text in a list row

it is surpisely easy, from the notepad example,

private void fillData() {
// Create an array to specify the fields we want to display in the list (only TITLE)
- String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
-//NotesDbAdapter.KEY_TITLE,

+ String[] from = new String[]{NotesDbAdapter.KEY_TITLE,NotesDbAdapter.KEY_BODY};
// and an array of the fields we want to bind those fields to (in this case just text1)
- int[] to = new int[]{R.id.text1};
+ int[] to = new int[]{R.id.text1,R.id.text2};
+
-
}
Then, in the row xml, add one more Textview which id is text2, so now we have price in the list. This same feature should be included in the first release of IStockDroid, anyway..now is not too late!

沒有留言:

發佈留言