Why does setText() show "N/A" when Info2
= ""? Why does data appear when Info2
has data but when Info2
does not have data my setText() call shows blank, not "N/A"?
JSON CODE >> {"AirlineInfoResult":{"name":"Malaysian Airlines System","shortname":""}}
String Info2 = ... do something util receive result from shortname
if(Info2.equals("")) {
shortname.setText("N/A");
}
else if(!Info2.equals("")) {
shortname.setText(Info2);
}