hmm only things I can think of is to check the length and make sure you don't have any extra spaces in there. ALso, try printing it out to your console right before you try to parse it to be sure it really is the value you expect.
My guess is that your string isn't what you think it is. You could
test the parsing function by putting a known string value("0" or "1") directly into the parse method to prove that it works. It will, I'm sure, but just to test all points of failure...
HTH