Ändra din tabellstruktur till detta
private static final String CREATE_USER_TABLE = "CREATE TABLE IF NOT EXISTS " + TABLE_LOCATIONS + "("
+ UID + " TEXT PRIMARY KEY," + ADDRESS + " TEXT,"
+ LONGITUDE + " TEXT," + LATITUDE + " TEXT,
UNIQUE(" + LOGITUDE + "," + LATITUDE + ") ON CONFLICT REPLACE)";
När du sedan sätter in, använd metoden nedan
ContentValues insertValues = new ContentValues();
insertValues.put(LATITUDE, latitude);
insertValues.put(LOGITUDE, longitude);
db.insertWithOnConflict(TABLE_LOCATIONS, null, insertValues, SQLiteDatabase.CONFLICT_REPLACE);