android - Redmi 上的 Intent ACTION_FINGERPRINT_ENROLL 导致异常
问题描述
在小米红米 Note 9 Pro 上,我们尝试使用以下代码打开指纹注册:
val intent = Intent(Settings.ACTION_FINGERPRINT_ENROLL)
startActivityForResult(intent, SETTINGS_FINGERPRINT_ENROLLMENT_REQUESTCODE)
这导致以下异常
java.lang.RuntimeException:
Unable to start activity ComponentInfo{com.android.settings/com.android.settings.biometrics.fingerprint.FingerprintEnrollIntroduction}:
java.lang.IllegalStateException:
You need to use a miui theme (or descendant) with this activity.
我们在 a 中调用代码,try/catch
但它仍然使我们最重要的活动崩溃。
我是否被迫在我的应用程序中使用 miui 主题来启动指纹注册?不能将我们的应用主题更改为 miui 主题来解决此问题。
是否有小米推出的特殊意图动作或其他实现指纹登记的方式?
使用Intent(Settings.ACTION_SECURITY_SETTINGS)
打开安全设置并不能解决问题,因为似乎没有可用于添加指纹的选项
解决方案
推荐阅读
- c - Tensorflow:TF_SessionRun 返回 TF_INVALID_ARGUMENT
- ag-grid - 排序前从 rowModelType 更改 ag-grid
- arrays - 计算两个数组中的相同值
- python - Python:将#放在几行的前面
- php - 无法让 XDebug 在 Visual Studio Code 中工作
- python - 如何使用python“格式”通过未知数量的变量创建目录
- android - 如果应用程序已打开,深层链接将不起作用
- javascript - “错误:你已经转发了这条推文。” 如何忽略已在 JavaScript 中转发的推文?
- r - 在管道工 API 中读取本地 csv
- python - 如何将嵌套的 json 转换为以下格式?