Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public long totalRouteTime(int routeNo)
- {
- long minTime, maxTime, diffTime = 0;
- SQLiteDatabase db = getReadableDatabase();
- try {
- Cursor results = db.rawQuery("SELECT MAX(" + TIME + ") FROM " + TABLE_NAME + " WHERE " + ROUTE_NUMBER + " == " + routeNo, null);
- if (results.moveToFirst()) {
- maxTime = results.getLong(0);
- }
- results.close();
- } catch (Exception e) {
- Log.e(FixOpenHelper.class.getName(), "Unable to get maxTime for Route "+ routeNo+".", e);
- }
- return diffTime;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement