user1371486
user1371486

Reputation: 39

Sorting database columns according to time in Android?

I am making an application in which I set the URI of a captured image in database, which I have done like this:

db.openDataBase();
                 Calendar cal = new GregorianCalendar();
                 ContentValues initialvalue = new ContentValues();
                 initialvalue.put("CreatedDate",cal.getTimeInMillis());
                 initialvalue.put("ImageUrl", outputFileUri.toString());
                 long rowis = db.insertRecordsInDB("Note", null,initialvalue);
                 db.close();

I want to get image from listview sorted by date. How can I do this?

Upvotes: 0

Views: 124

Answers (2)

Krishnakant Dalal
Krishnakant Dalal

Reputation: 3578

Sql Ordered Query Example :

SELECT * FROM Persons ORDER BY LastName DESC

SELECT * FROM Persons ORDER BY LastName ASC

Upvotes: 1

ernell
ernell

Reputation: 356

Wrong: ORDERBY

Right: ORDER BY

Upvotes: 0

Related Questions