小编abh*_*pet的帖子

在 Javascript 中设置样式更改事件监听器

我的 div 看起来像这样:

<div tabindex="0" role="button" id="profile-pic" style="background-image: "Some url";"></div>
Run Code Online (Sandbox Code Playgroud)

背景图像将根据某些标准进行更新。我想将侦听器设置为样式属性并侦听背景图像更改。是否可以?

html javascript dom-events

3
推荐指数
1
解决办法
1万
查看次数

Android 生物识别:IllegalStateException。必须至少注册一项生物识别才能创建需要用户身份验证的密钥

我正在使用 android Biometricx 库进行面部和指纹认证。当仅注册 FaceID 并且我尝试创建密钥时,我收到“ IllegalStatException:必须至少注册一个生物识别才能创建需要用户身份验证的密钥

我正在尝试像这样创建secretKey

            try {
                
                mKeyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME,
                        KeyProperties.PURPOSE_ENCRYPT |
                                KeyProperties.PURPOSE_DECRYPT)
                        .setBlockModes(KeyProperties.BLOCK_MODE_CBC)
                        // Require the user to authenticate with a fingerprint to authorize every use
                        // of the key
                        .setUserAuthenticationRequired(true)
                        .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)
                        .build());
                secretKey = mKeyGenerator.generateKey();
            } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException
                    | CertificateException | IOException e) {
                Toast.makeText(this,"Create Key "+ e.getLocalizedMessage(), Toast.LENGTH_LONG).show();
            }
Run Code Online (Sandbox Code Playgroud)

注册指纹后,代码工作正常。只有在注册 FaceId 时才会发生这种情况。我在这里缺少什么?

android androidx android-biometric-prompt android-biometric

3
推荐指数
1
解决办法
559
查看次数