From 1ae1a79d22e712bcc3e8af06dc4cd1e7246cb0b9 Mon Sep 17 00:00:00 2001 From: rladmsdh Date: Thu, 14 Sep 2023 11:31:34 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20save=20login=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xquare/xquare_android/MainActivity.kt | 12 ------------ .../com/xquare/xquare_android/XquareApplication.kt | 5 ----- 2 files changed, 17 deletions(-) diff --git a/app/src/main/java/com/xquare/xquare_android/MainActivity.kt b/app/src/main/java/com/xquare/xquare_android/MainActivity.kt index 3b1372e3..81cf4040 100644 --- a/app/src/main/java/com/xquare/xquare_android/MainActivity.kt +++ b/app/src/main/java/com/xquare/xquare_android/MainActivity.kt @@ -273,18 +273,6 @@ fun getToken(context: Context): String? { return token } -// 캐시 메모리 삭제 -fun clearCache(context: Context) { - val cacheDir = context.cacheDir - if (cacheDir.isDirectory) { - val children = cacheDir.list() - for (i in children!!.indices) { - File(cacheDir, children[i]).delete() - } - } -} - - fun Context.getActivity(): ComponentActivity? = when (this) { is ComponentActivity -> this is ContextWrapper -> baseContext.getActivity() diff --git a/app/src/main/java/com/xquare/xquare_android/XquareApplication.kt b/app/src/main/java/com/xquare/xquare_android/XquareApplication.kt index a823931d..20c8fb8f 100644 --- a/app/src/main/java/com/xquare/xquare_android/XquareApplication.kt +++ b/app/src/main/java/com/xquare/xquare_android/XquareApplication.kt @@ -15,11 +15,6 @@ class XquareApplication : Application() { super.onCreate() AndroidThreeTen.init(this) FirebaseApp.initializeApp(this) - - val sharedPrefs = getSharedPreferences("token", Context.MODE_PRIVATE) - // 데이터 모두 삭제 - sharedPrefs.edit().clear().apply() saveDeviceToken(this) - clearCache(this) } }