简体   繁体   中英

Android: How to check the TextView value that get from MySQL with string “pending”?

Currently, my EditText will display any value that store in a column named 'comment'. But, if the EditText display text "pending" which is retrieved from that column(comment), it should not display automatically. I want to know, how to avoid the EditText from displaying "pending"?. Should be used if else statement? But how?

Below is the EditText code that displays a text which is retrieved from MySQL.

etComment.setText(user.getComment());

You can use the If-Else condition to avoid display the "pending" in the edit text.

Code:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM