How to reset SqLite database in Android?

Roland picture Roland · Jan 30, 2014 · Viewed 42.3k times · Source

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.

Answer

Linga picture Linga · Jan 30, 2014

Just delete your database by

context.deleteDatabase(DATABASE_NAME);

Please make sure to close your database before deleting.