src/main/java/de/blau/android/photos/PhotoIndex.java
/**
     * Check if we have already indexed the photo
     * 
     * @param db a readable database
     * @param uriString the Uri for the photo
     * @return true if already present
     */
Check if we have already indexed the photo

@param db a readable database
@param uriString the Uri for the photo
@return true if already present
Check if we have already indexed the photo @param db a readable database @param uriString the Uri for the photo @return true if already present
private boolean isIndexed(@NonNull SQLiteDatabase db, @NonNull String uriString) {
        Cursor dbresult = null;
        try {
            dbresult = db.query(PHOTOS_TABLE, new String[] { URI_COLUMN }, URI_COLUMN + "  = ?", new String[] { uriString }, null, null, null, null);
            return dbresult.getCount() > 0;
        } catch (Exception ex) {
            Log.e(DEBUG_TAG, ex.getMessage());
            return true;
        } finally {
            close(dbresult);
        }
    }
private boolean isIndexed ( @ NonNull SQLiteDatabase db , @ NonNull String uriString ) { Cursor dbresult = null ; try { dbresult = db . query ( PHOTOS_TABLE , new String [ ] { URI_COLUMN } , URI_COLUMN + "  = ?" , new String [ ] { uriString } , null , null , null , null ) ; return dbresult . getCount ( ) > 0 ; } catch ( Exception ex ) { Log . e ( DEBUG_TAG , ex . getMessage ( ) ) ; return true ; } finally { close ( dbresult ) ; } }
Check if we have already indexed the photo
Check if we have already indexed the photo