Změňte strukturu tabulky na toto
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)";
Poté, když provedete vložení, použijte níže uvedenou metodu
ContentValues insertValues = new ContentValues();
insertValues.put(LATITUDE, latitude);
insertValues.put(LOGITUDE, longitude);
db.insertWithOnConflict(TABLE_LOCATIONS, null, insertValues, SQLiteDatabase.CONFLICT_REPLACE);