Example usage for android.database.sqlite SQLiteDatabase setForeignKeyConstraintsEnabled

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

Introduction

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

Prototype

public void setForeignKeyConstraintsEnabled(boolean enable) 

Source Link

Document

Sets whether foreign key constraints are enabled for the database.

Usage

From source file:com.shalzz.attendance.DatabaseHandler.java

@Override
public void onConfigure(SQLiteDatabase db) {
    super.onConfigure(db);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        db.setForeignKeyConstraintsEnabled(true);
    }//from  ww  w . j a  v  a 2s . co m
    db.enableWriteAheadLogging();
}