code: public static long firstLong(Cursor cursor, boolean close) {
          long l = cursor.moveToFirst() ? cursor.getLong(0) : Long.MIN_VALUE;
          close(cursor, close);
          return l;
      }
docs: Get the long value in the first row and column.
  
  @param close true to close the cursor or false to leave it open
  @return {@link Long#MIN_VALUE} if the cursor is empty