E. Reuter
E. Reuter

Reputation: 129

Android-app: Old database still exists after switching to room database

After switching to a room database I deleted the SQLite-Helper Class. But if I install my app the old database is still created on my smartphone.

I opened the the device file explorer and found under my project-folder /databases with the following databases

local.db which is my old database with date of 1970-01-19 and 2.5 MBytes local_db which is the new room database local_db-shm and local_db-wal whhich seem to be some room data

Even if I uninstall the app and reinstall it the local.db appears again. Deleting it does not help too.

But I think that I have deleted all the old SQLiteHelper Code. So does anyone know, where I might find the key to getting rid of the old database?

Upvotes: 2

Views: 1088

Answers (1)

MikeT
MikeT

Reputation: 57073

If the manifest (AndroidMainfest.xml) has android:allowBackup="true", this could result in the data being restored automatically by the backup manager. From your description of the issue this could well be the cause.

Try changing to use android:allowBackup="false", uninstalling the App and then re-installing.

Upvotes: 6

Related Questions