I have used a switch statement that takes string values from a spinner. Now, there are a lot of such string values. It looks something like this:
switch (spin.getSelectedItem()) {
case "first option", "second option", "third option":
result = 1;
break;
case "fourth option", "fifth option", "sixth option":
result = 2;
break;
case "seventh option", "eighth option", "ninth option";
result = 3;
break;
}
However, an error appears saying that enhanced switch blocks are not supported at language level 7. I have tried changing the source compatibility and target compatibility in the module settings, but it still doesn't work. Any advice and help is highly appreciated.