Reputation: 1015
Iam retrieving data from the database and displaying it as a list, in the list i want to display the last inserted one as the first and soon How to acheive this?
Iam fetching data using the following query
public Cursor fetchdata() {
DBHelper.onOpen(db);
Cursor mCursor = db.query(DATABASE_Table, new String[] { "Message",
, "UserInfo", "timeStamp" }, null,
null, null, null, null);
return mCursor;
}
Upvotes: 0
Views: 1154
Reputation: 7605
i think you have use this way may help full
Cursor c=dbAdapter.fetchdata();
int MSG=.getColumnIndex("Message");
for(c.moveToLast();!c.isBeforeFirst();c.moveToPrevious())
{
}
Upvotes: 0