【问题标题】:alphabetic password not working字母密码不起作用
【发布时间】:2015-12-19 10:39:01
【问题描述】:

我在 android 开发中遇到了一个问题,其中带有数字(6823969093)的密码可以正常工作,但带有字母(helloworld 或 hello34world)的密码不起作用。

谢谢

final EditText editTextemail = (EditText) findViewById(R.id.editEmail);
    final EditText editTextpassword = (EditText) findViewById(R.id.editPassword);
    Button buttonSubmit = (Button) findViewById(R.id.btnSubmit);
    final CheckBox showPasswordCheckBox = (CheckBox) findViewById(R.id.checkBox);
    showPasswordCheckBox.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (showPasswordCheckBox.isChecked()){
                editTextpassword.setTransformationMethod(null);
            }else{
                editTextpassword.setTransformationMethod(new PasswordTransformationMethod());
            }
        }
    });
    buttonSubmit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            email = editTextemail.getText().toString();
            password = editTextpassword.getText().toString();
            handler = new DBHandler(getBaseContext());
            handler.open();
            handler.addLogIn(email, password);
            handler.close();
            finish();
        }
    });

【问题讨论】:

  • 改为发布您的数据库代码。表创建和插入代码。我想这是一个很容易解决的问题。
  • public static final String TABLE_CREATE3 = "创建表logInTable(logInEmail文本不为空,密码文本不为空);";这是一个查询,用于创建表。
  • 和数据插入方法是:public long addLogIn(String logInEmail,String password){ ContentValues values = new ContentValues(); values.put(COLUM_Email,logInEmail); values.put(COLUM_Password,password);返回 db.insertOrThrow(TABLE_NAME3,null,values); }
  • 请解释一下“不工作”对您意味着什么。
  • 不工作的意思是“无法使用字母密码登录,例如 hello65world 等”

标签: android passwords numbers


【解决方案1】:

步骤 1] 转到密码字段的 Edit-text 属性。

第 2 步] 从输入类型中选择您的密码模式或过滤器。

【讨论】:

  • 我已经检查了编辑文本属性,但我找不到像“模式”或“过滤器”这样的属性。
  • Namik kalavadia 我只能找到 textFilter。这也不起作用。
  • Khawar ali.. 我已经编辑了我的答案.. 你能找到编辑文本的这个属性吗? ?
猜你喜欢
  • 2022-01-16
  • 2014-02-07
  • 2015-10-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-22
  • 2010-11-09
  • 2018-10-05
相关资源
最近更新 更多