簡體   English   中英

Android:如何使用字符串“pending”檢查從MySQL獲取的TextView值?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM