# [android] 캐시데이터 삭제하는 방법 ( delete app cache)
앱 개발시에 서버 데이터를 변경했는데 적용이 안되는 경우 이 경우에는 앱의 캐시를 삭제 예제 /** * deleteCache * @param context */ fun deleteCache(context: Context) { try { val cache: File = context.cacheDir val appDir = File(cache.parent) if (appDir.exists()) { val children: Array = appDir.list() for (s in children) { //다운로드 파일은 지우지 않도록 설정 if (s == "lib" || s == "files") continue deleteDir(File(appDir, s)) } } }catch (e:Exception){ Lo..
2020.03.05