我试图在用户登录或登录时进行进度对话,但当我运行它时,它一直显示:
Edit text cannot be converted to char sequence
mRegProgress = new ProgressDialog(this);
if(!TextUtils.isEmpty(username) || !TextUtils.isEmpty(email) || !TextUtils.isEmpty(password)){
mRegProgress.setTitle("Registering User");
mRegProgress.setMessage("Please wait while we create your account !");
mRegProgress.setCanceledOnTouchOutside(false);
mRegProgress.show();
register_user(username, email, password);
}
我希望它能够运行,而 android studio 不会向我显示错误,并且当用户登录时会出现进度对话框。
最佳答案
Edit text cannot be converted to char sequence
问题可能是因为以下代码:
if(!TextUtils.isEmpty(username) || !TextUtils.isEmpty(email) || !TextUtils.isEmpty(password)){
其中用户名
、电子邮件
或密码
是EditText。 TextUtils.isEmpty()
需要一个 CharSequence
作为方法参数。
然后检查以下方法是否存在上述相同问题:
register_user(username, email, password);
除此之外,请将您的错误日志添加到您的问题中。
关于java - EditText 无法转换为 CharSequence,EditText 无法转换为 String,找不到符号方法 getEditText(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56689087/