In my activity I have for example
SQLiteDatabase db = openOrCreateDatabase(Preferences.DB_NAME, Context.MODE_PRIVATE, null);
db.execSQL(\"CREATE TABLE IF NOT
Above of other answers, one very important feature in SQLiteOpenHelper class, it has 2 synchronized methods, getWritableDatabase() and getReadableDatabase().
That means your database operations are thread safe.
Code snippet from SQLiteOpenHelper class
public SQLiteDatabase getReadableDatabase() {
synchronized (this) {
return getDatabaseLocked(false);
}
}
and
public SQLiteDatabase getWritableDatabase() {
synchronized (this) {
return getDatabaseLocked(true);
}
}