简体   繁体   English

Android领域,应用程序卸载

[英]Android realm, app uninstall

I have a simple android app with a realm db/2 tables. 我有一个带域db / 2表的简单android应用。

When I uninstall my application, all the realm databases/tables are deleted from my app, or not? 当我卸载应用程序时,所有领域数据库/表都从我的应用程序中删除了吗?

Fundamentally, yes . 从根本上讲, 是的 The database and tables are deleted on uninstall. 卸载时将删除数据库和表。

However, there exists cases when they are not deleted. 但是,存在不删除它们的情况。

Gotten from https://github.com/realm/realm-java/issues/2992 https://github.com/realm/realm-java/issues/2992获得

When you uninstall the application, your /data/data/com.example.acme folder should be erased. 卸载应用程序时,应删除/data/data/com.example.acme文件夹。 If you're specifically opening the Realm on the external storage (and not inside of your internal storage dedicated data folder as per context.getFilesDir()), then the Realm file will not be removed. 如果您专门在外部存储设备上打开Realm(而不是根据context.getFilesDir()在内部存储设备专用数据文件夹内部),则不会删除Realm文件。

The Realm.getDefaultInstance() and Realm.getInstance(Context) calls open the Realm in getFilesDir(), which means it should be deleted along with the application. Realm.getDefaultInstance()和Realm.getInstance(Context)调用在getFilesDir()中打开领域,这意味着应与应用程序一起将其删除。

Maybe you're being a victim of the new Android's auto-backup feature? 也许您是新的Android自动备份功能的受害者?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM