gaoyangcr7 / BiometricPromptDemo

Android fingerprint, Api23 and Api28 are supported
144 stars 51 forks source link

BiometricPromptApi28对cancel的监听存在问题 #4

Closed monkey000 closed 5 years ago

monkey000 commented 5 years ago

按返回键取消时 并不会调用到onCancel()方法

gaoyangcr7 commented 5 years ago

你什么手机?我找个手机试试

monkey008 commented 5 years ago

你什么手机?我找个手机试试

最新的AOSP代码编译出的模拟器镜像

gaoyangcr7 commented 5 years ago

能详细描述一下只的是哪个onCancel吗,现在有点懵

monkey000 commented 5 years ago

`

    mButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (mManager.isBiometricPromptEnable()) {
                mManager.authenticate(new BiometricPromptManager.OnBiometricIdentifyCallback() {
                    @Override
                    public void onUsePassword() {
                        Toast.makeText(MainActivity.this, "onUsePassword", Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onSucceeded() {

                        Toast.makeText(MainActivity.this, "onSucceeded", Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onFailed() {

                        Toast.makeText(MainActivity.this, "onFailed", Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onError(int code, String reason) {

                        Toast.makeText(MainActivity.this, "onError", Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onCancel() {

                        Toast.makeText(MainActivity.this, "onCancel", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    });

` MainActivity里设置的回调方法onCancel 在使用BiometricPromptApi28时不会被触发

gaoyangcr7 commented 5 years ago

已修复,多谢反馈