You should never compare two Strings with "==". Always with <object>.equals(<other>) or variations on it.

Your problem is that you're testing for two conditions that should have been related:
if...