如何在 Android 中实例化 FileIntegrityManager?

问题描述 投票:0回答:1

如何在 Android 中实例化 FileIntegrityManager

语言:Kotlin Android Studio HedgeHog | Android Studio 2023年1月1日(2023年11月) 目标SDK 33

val foo = FileIntegrityManager()// Compile Error:  Error message says init is private so you cannot access it.

我检查了 FileIntegrityManager 声明的文件中的另一个初始值设定项,但看起来开发人员无法访问它。你如何初始化这个类?

我应该实例化 FileIntegrityManager。

android kotlin
1个回答
0
投票

您不自己创建实例。相反,在

getSystemService(FileIntegrityManager::class.java)
上调用
Context
来获取
FileIntegrityManager
实例。

理论上,您也可以将

FILE_INTEGRITY_SERVICE
传递给
getSystemService()

© www.soinside.com 2019 - 2024. All rights reserved.