You're comparing byte[]
instances, arrays of bytes. The ==
operator won't compare array contents, only to see if they're the same array object, which they aren't.
To compare array contents, use Arrays.equals
:
if(Arrays.equals(line.getBytes(), "RunApp: ON".getBytes()))
You'll need to change your other array comparisons similarly.