开发者

android 2.2 data still exists after uninstall

开发者 https://www.devze.com 2023-03-25 12:32 出处:网络
I have an app using purely webview. I also stored some ids using Share开发者_JAVA技巧dPreferences.

I have an app using purely webview. I also stored some ids using Share开发者_JAVA技巧dPreferences.

I realised that even after clearing data, and uninstall, some data still appears to exist. because when I reinstall the app, the webviews which points to a login url, still shows the login id. only when I reset the device to factory default, then the login credentials will disappear.

is there something wrong here?


onDestroy of your activity wrtie this

            yourWebView.clearCache(true);
            yourContext.deleteDatabase("webview.db");
            yourContext.deleteDatabase("webviewCache.db");


You are saving data into sharedpreferences which is stored in an xml file in /data/data/(package name)/shared_prefs directory. This data cannot be clear by clearing cache. To remove it, you have to be in your application and get SharedPreferences.Editor and call editor.clear() and then editor.commit().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号