From 4acad12de982843148d2cb69fc5c75a6054e1995 Mon Sep 17 00:00:00 2001 From: Lucas Frossard Date: Mon, 15 May 2023 15:49:46 -0700 Subject: [PATCH] [SampleApp-Android] Removing auto-validation. User have to click the button to validate the code. --- .../otp/sample/app/fragment/OtpValidatorFragment.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Android/app/src/main/java/com/whatsapp/otp/sample/app/fragment/OtpValidatorFragment.java b/Android/app/src/main/java/com/whatsapp/otp/sample/app/fragment/OtpValidatorFragment.java index a514b1d..c497efa 100644 --- a/Android/app/src/main/java/com/whatsapp/otp/sample/app/fragment/OtpValidatorFragment.java +++ b/Android/app/src/main/java/com/whatsapp/otp/sample/app/fragment/OtpValidatorFragment.java @@ -122,9 +122,7 @@ public void onResume() { this.fillCode(extras); this.showDebugMessages(extras); String filledCode = binding.otpCodeInputId.getText().toString(); - if (!filledCode.isEmpty()) { - binding.validateOtp.callOnClick(); - } else { + if (filledCode.isEmpty()) { listenForCodeToAutoSubmit(); } } @@ -136,10 +134,6 @@ public void onReceive(Context context, Intent intent) { if (intent != null) { String code = intent.getStringExtra("code"); OtpValidatorFragment.this.binding.otpCodeInputId.setText(code); - FragmentActivity activity = getActivity(); - if (activity != null && isAdded()) { - OtpValidatorFragment.this.binding.validateOtp.callOnClick(); - } } } };