How to delete SQLite database from Android programmatically

前端 未结 12 1652
猫巷女王i
猫巷女王i 2020-11-27 10:41

I would like to delete the database file from the Android file system programatically? Can I have a shell script launch adb which in turns runs a

12条回答
  •  感动是毒
    2020-11-27 11:20

    Once you have your Context and know the name of the database, use:

    context.deleteDatabase(DATABASE_NAME);
    

    When this line gets run, the database should be deleted.

提交回复
热议问题