java - 号码格式错误

标签 java android validation

我遇到了以下问题:

这是我的验证 Activity 代码:

 public void sendVerificationCode(String mobile){
      CodeBar.setVisibility(View.VISIBLE);
      PhoneAuthProvider.getInstance().verifyPhoneNumber(
              "+55"+mobile,
              60,
              TimeUnit.SECONDS,
              TaskExecutors.MAIN_THREAD,
              mCallBack

这是我在 mainActivity 中的代码:

String mPhone = "+"+55+number;
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
intent.putExtra("mobile", mPhone);
startActivity(intent);
Log.d("clima","hey "+ "+"+55+number);

enter image description here

最佳答案

由于数字格式是问题所在,我认为您最好的做法是添加对 sendVerificationCode 方法的 Log.d 调用。所以它看起来像这样:

public void sendVerificationCode(String mobile){
  Log.d("NumberCheck", "The string mobile is - " + mobile); //This should help you identify what the issue is
  CodeBar.setVisibility(View.VISIBLE);
  PhoneAuthProvider.getInstance().verifyPhoneNumber(
          "+55"+mobile,
          60,
          TimeUnit.SECONDS,
          TaskExecutors.MAIN_THREAD,
          mCallBack

然后您应该能够看到导致问题的原因。

关于java - 号码格式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53842252/

相关文章:

java - 是否可以在 lotus notes 中调试 Java(不是 Javascript)脚本库(不是代理)?

java - 在 websphere 8.5.5.9 上初始化 Spring Boot

java - 如何在 Eclipse 模拟器运行时切换方向

java - 如何动态创建类 Java

jquery - 开箱即用的验证文本

java - itext如何检查pdf页面上是否存在巨型字符串

java - key key = new SecretKeySpec(keyValue, "AES");在 Objective C 中

android - 使用 Android Q ffmpeg 拒绝权限” : error=13, 权限被拒绝

jquery - asp.net mvc 3 中的远程验证不起作用

ruby-on-rails - RoR 3.1 中的 password_digest、has_secret_password 和表单验证