Reputation: 923
I am creating an Android app and the database is being persisted after uninstalls. When I uninstall the app, the application dir is destroyed (/data/user/0/<name>), which is good. But when I install the app again, the database is restored with the old data.
With the application uninstalled, I'll hit the debug button on Android Studio which installs the APK. I put a breakpoint on the very first line of my application class (the one that extends Application), and while that breakpoint is hit, I navigated to the /data/user/0/<app name>/databases folder and did an ls and the DB is there. It never even hit my database class yet to init it. I'm stumped and can't figure out why it's doing this.
Here's how I've tried to debug it thus far:
The phone I'm on is a Nexus 6p running Android 7.0.
Android Studio information:
Android Studio 2.2.1
Build #AI-145.3330264, built on October 6, 2016
JRE: 1.8.0_112-release-b05 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
tl;dr, my app database keeps coming back after uninstalls/device wipes.
Upvotes: 2
Views: 1237
Reputation: 337
Have you tried adding this to your android manifest?
<application
android:allowBackup="false"
tools:replace="android:allowBackup">
remember it should be inside the application tag.
Upvotes: 2