public <T> T selectFirstRow(final SQLiteDatabase db, final Func1<Cursor, T> mapper) {

            return withAccessLock(() -> {


                try (Cursor c = openCursorFor(db, "1")) {
                    final List<T> result = new ArrayList<>();
                    if (c.moveToNext()) {
                        return mapper.call(c);
                    }
                    return null;
                }
            });
        }
if returned id is < 0 then there is no offline log for given geocode
main/src/main/java/cgeo/geocaching/storage/DataStore.java