'Variable retrieved from json data doesn't seem right
I retrieve data from mysql server and one of the fields is an int value (1 or 0 ) and it's printed right (1 or zero ) but when I try to apply an if condition on this variable for example :
if (currentCourse.getForFreeStr() !=0)forFree.setVisibility(View.GONE);
the condition always give the result for != 0
I also tried to take the value as a String and put make the condition :
if (currentCourse.getForFreeStr() !="0")forFree.setVisibility(View.GONE);
it does the same please tell me what is wrong . note : when I use the same codes on the data retrieved from a similar table in another database it works fine !
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|