Database won't remove when uninstall the Android Application

后端 未结 5 798
执念已碎
执念已碎 2021-01-30 12:49

I have two major questions.

  1. Database won\'t delete when uninstall app.
  2. Downloaded files won\'t delete while unstable the app.

There is a d

5条回答
  •  独厮守ぢ
    2021-01-30 13:29

    1. Take a look at this SO answer:

    What happens to a Sqlite database when app is removed

    1. Does your DB work (aside from not deleting when removing the app)?

    2. If it isn't working properly, you may want to take a look at:

    http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html

    Although this is not necessarily related to your issue, you might want to consider creating an open() and close() for your DB and use a SQLiteOpenHelper object in each - in open(), you would use sqliteopenhelperObj.getWriteableDatabase() and in close() you would use sqliteopenhelperObj.close().

    http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#close

    Edit:

    1. If you've downloaded files to your device during the process of testing an app, and you want to delete them, you can use the Device Monitor in Android Studio https://developer.android.com/tools/help/monitor.html There's a file manager that will allow you to see and edit files on your devices. You can also do this on the command line with the ADB (Android Debug Bridge) https://developer.android.com/tools/help/adb.html

提交回复
热议问题