When I release an update for my app in Playstore, mostly it doesn't require clear Data/cache. But sometimes we want it to clear data on Update.
Is there a way, maybe a flag to enable, to automatically clear my App Data or Cache for a specific Update?
Or will I need to hanlde it myself through shared preferences?
Well we have to handle it internally. Here is how I am handling it.
For any version if it is required to clear data, I create a field with app versionCode to clear data for in gradle file:
In my first Activity, I check if data is cleared for the version or not: