mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
Make YukiHookModulePrefs singleton
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
## YukiHookModulePrefs [class]
|
||||
|
||||
```kotlin
|
||||
class YukiHookModulePrefs(private val context: Context?)
|
||||
class YukiHookModulePrefs(private var context: Context?)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
@@ -539,7 +539,7 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// 可以使用但是不推荐
|
||||
// ❗为防止存在多个实例 - 不要这样使用
|
||||
YukiHookModulePrefs(this).getBoolean("test_data")
|
||||
// ✅ 推荐的使用方法
|
||||
modulePrefs.getBoolean("test_data")
|
||||
|
Reference in New Issue
Block a user