From eac5b8ed6054ecb650b9f2ff2f1cda1726146998 Mon Sep 17 00:00:00 2001 From: harjot-oberai Date: Fri, 19 Feb 2016 15:50:13 +0530 Subject: [PATCH] Added : Sort Functionality --- .../com/example/haresh/tic_tac_toe_app/DatabaseHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/haresh/tic_tac_toe_app/DatabaseHandler.java b/app/src/main/java/com/example/haresh/tic_tac_toe_app/DatabaseHandler.java index 35e1195..8953713 100644 --- a/app/src/main/java/com/example/haresh/tic_tac_toe_app/DatabaseHandler.java +++ b/app/src/main/java/com/example/haresh/tic_tac_toe_app/DatabaseHandler.java @@ -79,7 +79,7 @@ public scoreboard getPlayer(String name) { public List getAllContacts() { List scoreList = new ArrayList(); // Select All Query - String selectQuery = "SELECT * FROM " + TABLE_SCORES; + String selectQuery = "SELECT * FROM " + TABLE_SCORES + " ORDER BY " + KEY_SCORE + " DESC"; SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(selectQuery, null);