Example usage for android.database.sqlite SQLiteDatabase openDatabase

List of usage examples for android.database.sqlite SQLiteDatabase openDatabase

Introduction

In this page you can find the example usage for android.database.sqlite SQLiteDatabase openDatabase.

Prototype

public static SQLiteDatabase openDatabase(@NonNull String path, @Nullable CursorFactory factory,
        @DatabaseOpenFlags int flags, @Nullable DatabaseErrorHandler errorHandler) 

Source Link

Document

Open the database according to the flags #OPEN_READWRITE #OPEN_READONLY #CREATE_IF_NECESSARY and/or #NO_LOCALIZED_COLLATORS .

Usage

From source file:Main.java

public static SQLiteDatabase openOrCreateDatabase(String path, SQLiteDatabase.CursorFactory factory) {
    return SQLiteDatabase.openDatabase(path, factory, SQLiteDatabase.CREATE_IF_NECESSARY, null);
}