You can create your own Adapter class (by extending BaseAdapter) and do your formatting in the getView() function.
-- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On May 21, 11:01 am, Kent Yip <yes...@gmail.com> wrote: > i have the code below which almost done everything i wanted, but i want to > be able to alter one of the field(KEY_TIME) to a more readable format. > > because the value in column KEY_TIME is gonna be in milliseconds, simply > displaying the large value is not ready to user. > > private void fillData() { > > Cursor notes= mDbHelper.fetchAllNotes(); > startManagingCursor( tasksCursor ); > > String[] from = new String[] {ToDoDbAdapter.KEY_TITLE, > ToDoDbAdapter.KEY_LABEL, > ToDoDbAdapter.KEY_NOTE, > ToDoDbAdapter.KEY_TIME}; > int[] to = new int[] {R.id.task, R.id.label, R.id.note, R.id.time}; > > SimpleCursorAdapter noteAdapter = > new SimpleCursorAdapter( this, R.layout.list_row, notes, from, > to); > > setListAdapter( noteAdapter ); > > }// end fillData() method > > **************************************************************************************** > > i want to try something like this > > for(notes.moveToFirst(); notes.isAfterLast(); notes.moveToNext()){ > // do all the formatting i want to each fields > // add it to the list > } > > then set the adapter, the list has to be selectable for editing. > > is simply don't get how to tie the list with the cursor adapter and the > list_row.xml i prepared > > please help me out with some example --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---