clear Database by delete table by table names - Android Database

Android examples for Database:Table Drop

Description

clear Database by delete table by table names

Demo Code


//package com.java2s;

import android.database.sqlite.SQLiteDatabase;

public class Main {
    public static void clearDatabase(SQLiteDatabase database,
            String[] tables) {/*from  www. j a v a2s.c o  m*/
        for (int i = 0; i < tables.length; i++) {
            database.delete(tables[i], null, null);
        }
    }
}

Related Tutorials