« If » becomming crazy

TFEX

New Member
I try to program a calculator in order to learn the very begining in android dev, but I'm facing to an issue that an human can't understand. I hope you're not human.Take a look at my If condition :\[code\] if (result != "") { textView.append("0"); }\[/code\](You may notice that I used ? result != "" ? instead of isEmpty() method because isEmpty() isn't supported in API7).Well. Now take a look at my two "result" variable \[code\]result "" (id=830012674816) count 0 hashCode 0 offset 0 value (id=830012674848) result "" (id=830022154000) count 0 hashCode 0 offset 0 value (id=830022154032) \[/code\](I copied that two results from Eclipse Debugger)The first result is OK : that's the one I get when I start the program : the if does its job and pass over.The second one seems to be exactly the same, but for a unknown reason, it gets inside the if and appends the zero. I get this issue after pushing the "plus" button.Any idea ?If you find there is a lack of information or you don't understand the issue, you can find here the whole workspace (in progress) : http://www.sendspace.com/file/udp5d3 .To reproduce the issue, push "zero" button when programs launchs and note that it normally does not appear. Then enter any number such as "104", "7" or "73", push "Plus" button, then "zero". Zero should not appear here.Thank you :)
 
Top