How to reset SqLite database in Android?
问题 I want my users to be able to reset the application, then I need to reset the SQLite database that I have created. How can I do that? I want to reset the database or delete and recreate the database. 回答1: Just delete your database by context.deleteDatabase(DATABASE_NAME); Please make sure to close your database before deleting. 回答2: Bit late but this can help other people public void clearDatabase(String TABLE_NAME) { String clearDBQuery = "DELETE FROM "+TABLE_NAME; db.execSQL(clearDBQuery);