Advertisement
Ankhwatcher

Get Time Difference - Non functioning code

Mar 25th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public long totalRouteTime(int routeNo)
  2.     {
  3.         long minTime, maxTime, diffTime = 0;
  4.         SQLiteDatabase db = getReadableDatabase();
  5.         try {
  6.         Cursor results = db.rawQuery("SELECT MAX(" + TIME + ") FROM " + TABLE_NAME + " WHERE " + ROUTE_NUMBER + " == " + routeNo, null);
  7.         if (results.moveToFirst()) {
  8.             maxTime = results.getLong(0);
  9.         }
  10.         results.close();
  11.     } catch (Exception e) {
  12.         Log.e(FixOpenHelper.class.getName(), "Unable to get maxTime for Route "+ routeNo+".", e);
  13.     }
  14.         return diffTime;
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement