我正在尝试实现生物特征提示API以使用指纹验证来验证用户身份.我能够成功集成Biometric提示,并且它正在Andorid 9.0上运行.但是正如文档所示,Biometric api也向后兼容,但是当我使用以下代码构建对话框时,它会显示API支持警告.
Call requires API level 28 (current min is 15): new
android.hardware.biometrics.BiometricPrompt.Builder less… (Ctrl+F1)
This check scans through all the Android API calls in the application
and warns about any calls that are not available on all versions
targeted by this application (according to its minimum SDK attribute
in the manifest)
mBiometricPrompt = new BiometricPrompt.Builder(this)
.setDescription("Description")
.setTitle("Title")
.setSubtitle("Subtitle")
.setNegativeButton("Cancel", getMainExecutor(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Log.i(TAG, "Cancel button clicked");
}
})
.build();
我该怎么做才能在较低的api上实现此功能?这是截图.