I have a variable in the class "MainActivity" with the name modeNr, it is protected so it should be accessible from within the package, however whenever I try to alter it from a class in the same package it gives the error: "Non-static field 'modeNr' cannot be referenced from a static context". I use the following line to alter the variable:
MainActivity.modeNr = 1;
Any ideas on what the problem is and how to correct it?