mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-24 03:16:00 +00:00
Fix API
Add SharedPrefs helper class to access shared preferences
This commit is contained in:
@@ -25,8 +25,7 @@ class ManageSpaceActivity: FragmentActivity() {
|
||||
enableEdgeToEdge()
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
super.onCreate(savedInstanceState)
|
||||
val sharedPref = applicationContext.getSharedPreferences("data", MODE_PRIVATE)
|
||||
val authenticate = sharedPref.getBoolean("auth", false)
|
||||
val authenticate = SharedPrefs(applicationContext).auth
|
||||
val vm by viewModels<MyViewModel>()
|
||||
fun clearStorage() {
|
||||
filesDir.deleteRecursively()
|
||||
@@ -35,6 +34,7 @@ class ManageSpaceActivity: FragmentActivity() {
|
||||
if(Build.VERSION.SDK_INT >= 24) {
|
||||
dataDir.resolve("shared_prefs").deleteRecursively()
|
||||
} else {
|
||||
val sharedPref = applicationContext.getSharedPreferences("data", MODE_PRIVATE)
|
||||
sharedPref.edit().clear().apply()
|
||||
}
|
||||
finish()
|
||||
|
||||
Reference in New Issue
Block a user