List of usage examples for android.database.sqlite SQLiteCursor getLong
@Override public long getLong(int columnIndex)
From source file:com.chess.genesis.data.GameDataDB.java
public long getNewestOnlineTime() { final String username = getUsername(); final String[] data = { username, username }; final String query = "SELECT stime FROM onlinegames WHERE white=? OR black=? ORDER BY stime DESC LIMIT 1"; final SQLiteCursor cursor = (SQLiteCursor) db.rawQuery(query, data); try {/* w ww. j a v a 2 s .c o m*/ if (cursor.getCount() == 0) return 0; cursor.moveToFirst(); return cursor.getLong(0); } finally { cursor.close(); } }
From source file:com.chess.genesis.data.GameDataDB.java
public long getNewestMsg() { final String username = getUsername(); final String[] data = { username, username }; final SQLiteCursor cursor = (SQLiteCursor) db.rawQuery( "SELECT time FROM msgtable WHERE username=? OR opponent=? ORDER BY time DESC LIMIT 1", data); try {/*from ww w.j av a2s. c o m*/ if (cursor.getCount() == 0) return 0; cursor.moveToFirst(); return cursor.getLong(0); } finally { cursor.close(); } }