Delete all tables from sqlite database

后端 未结 4 1732
感情败类
感情败类 2020-12-17 10:06

I have done a lot of research and was unable to find a suitable method to delete all the tables in an SQLite database. Finally, I did a code to get all table names from the

4条回答
  •  盖世英雄少女心
    2020-12-17 11:02

    delete database instead of deleting tables and then create new with same name if you need. use following code

    context.deleteDatabase(DATABASE_NAME); 
              or
    context.deleteDatabase(path);
    

提交回复
热议问题