-3

I tried to make, history of webview. When I set database on listView with simpleCursorAdapter, it show last added item in end of list, like that:

this is KEY_ID list:

   1
   2
   3 
   4 
   5

but I want, that last added item show in start of list:

5 
4 
3 
2 
1

How to do it?

4

1 回答 1

1

You need to use DESC for fetch result in descending order and ASC for ascending order.

Cursor c = db.query(DATABASE_TABLE, projection_column, null, null, null, null, KEY_ID + "DESC"); 
于 2013-03-12T11:26:13.297 回答