[英]Android: How to check the TextView value that get from MySQL with string “pending”?
目前,我的EditText将显示存储在名为“comment”的列中的任何值。 但是,如果EditText显示从该列(注释)检索的文本“pending”,则不应自动显示。 我想知道,如何避免EditText显示“挂起”? 应该用if else语句吗? 但是怎么样?
下面是EditText代码,显示从MySQL检索的文本。
etComment.setText(user.getComment());
您可以使用If-Else条件来避免在编辑文本中显示“pending”。
码:
if(!user.getComment().equals("Pending")){
etComment.setText(user.getComment());
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.