0

Is it possible to write a function to clear the app cache on my app. I know that I can go to app settings and clear it that way but I want to be able to do that within my own app in code when its finished processing.

Any suggestions would be greatly appreciated.

I have tried Clear Cache in Android Application programmatically but the app still shows that the cache is not cleared.

I have also looked at How to delete app cache for all apps in Android M? but have not been able to write something to do this.

I have added <permission android:name="android.permission.CLEAR_APP_CACHE"/>to the manifest but this does not seem to make any difference.

RentUrApp
  • 1
  • 3
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 16 '23 at 13:36
  • Try looking at [How to Clear Cache Data in Android Application Programmatically](https://androidcource.blogspot.com/2018/07/clear-cache-data-in-android-app.html?m=1). – Alias Cartellano Feb 16 '23 at 17:51
  • This is the same code as the my first reference above: I have tried Clear Cache in Android Application programmatically and does noit clear the cache. – RentUrApp Feb 17 '23 at 10:51

0 Answers0