键盘管理员如何删除取消按钮

时间:2018-05-21 10:46:13

标签: java android keyguard

使用KeyguardManager时,如何删除取消按钮?左侧有一个取消按钮。

if(km.isKeyguardSecure()) {
            Intent i = km.createConfirmDeviceCredentialIntent("Authentication required", "password");
            startActivityForResult(i, CODE_AUTHENTICATION_VERIFICATION);
        }

  @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode==RESULT_OK && requestCode==CODE_AUTHENTICATION_VERIFICATION)
        {
            Toast.makeText(this, "Success: Verified user's identity", Toast.LENGTH_SHORT).show();
            Session.setLock(false);
            startActivity(new Intent(this,WelcomeACtivity.class));
        }
}

1 个答案:

答案 0 :(得分:0)

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode==RESULT_OK && requestCode==CODE_AUTHENTICATION_VERIFICATION)
        {
            Toast.makeText(this, "Success: Verified user's identity", Toast.LENGTH_SHORT).show();
            Session.setLock(false);

            startActivity(new Intent(context,WelcomeACtivity.class));

        }
        else if(resultCode == RESULT_CANCELED && requestCode == CODE_AUTHENTICATION_VERIFICATION)
        {
            finish();
        }
        else
        {
            Toast.makeText(this, "Failure: Unable to verify user's identity", Toast.LENGTH_SHORT).show();

        }
    }