Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KEY_INSTALL_DATE pref not cleared on uninstall #78

Open
oseparovic opened this issue Jan 30, 2017 · 1 comment
Open

KEY_INSTALL_DATE pref not cleared on uninstall #78

oseparovic opened this issue Jan 30, 2017 · 1 comment

Comments

@oseparovic
Copy link
Contributor

This line in onStart returns the same date no matter how many times I uninstall the app.

    mInstallDate = new Date(pref.getLong(KEY_INSTALL_DATE, 0));

The result is that on my test device I cannot properly test the functionality of RateThisApp because the prompt is always triggered on a fresh install. According to this SO post Android automatically backs up preferences to your account since SDK 21: http://stackoverflow.com/questions/15873066/how-to-remove-shared-preference-while-application-uninstall-in-android

However I already have android:allowBackup="false" and am still experiencing this issue. Does anyone have any suggestions?

@oseparovic
Copy link
Contributor Author

oseparovic commented Jan 30, 2017

Ah I found the reason for this. It looks like onStart directly pulls the install date from the package manager via storeInstallDate. Is this necessary? This will force persistent RateThisApp preferences between installs which some developers might want to avoid.

Edit: never mind it looks like this is somehow related to Android Studio. When I manually uninstalled the apk via adb commands and then reinstalled via adb the install date was properly reset. I guess Android Studio somehow persists preferences when installing debug builds? Any clarifications on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant