gpt4 book ai didi

java - 安卓 : How to check the TextView value that get from MySQL with string "pending"?

转载 作者:行者123 更新时间:2023-11-29 16:01:51 26 4
gpt4 key购买 nike

目前,我的 EditText 将显示存储在名为“comment”的列中的任何值。但是,如果 EditText 显示从该列(评论)检索到的文本“待处理”,则它不应自动显示。我想知道,如何避免 EditText 显示“pending”?应该使用if else语句吗?但如何呢?

下面是显示从 MySQL 检索的文本的 EditText 代码。

etComment.setText(user.getComment());

最佳答案

您可以使用If-Else条件来避免在编辑文本中显示“待处理”。

代码:

if(!user.getComment().equals("Pending")){
etComment.setText(user.getComment());
}

关于java - 安卓 : How to check the TextView value that get from MySQL with string "pending"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56124187/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com