21.02.2019, 02:01
You are recreating the prevStatus variable inside the loop, therefore it is always 0, create it outside / before the loop
Additionally you can move your "if(prevStatus != status)" statement after the switch because it is the same code in all cases
Additionally you can move your "if(prevStatus != status)" statement after the switch because it is the same code in all cases