I am making an app in Android Studio :
public class MainActivity extends AppCompatActivity {
SharedPreferences sharedPreferences;
EditText noteTitleField, noteContentField;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sharedPreferences = getSharedPreferences("NoteAppPrefs", Context.MODE_PRIVATE);
String setValueInPrefs = sharedPreferences.getString("alreadyLaunched", null);
try (setValueInPrefs.equals("0")) {
Log.d("debugging", "App running for first time... launching setup");
setupForFirstTime();
} catch (NullPointerException e) {
noteContentField = findViewById(R.id.noteContentTextBox);
noteTitleField = findViewById(R.id.noteTitleTextBox);
Toast.makeText(MainActivity.this, R.string.welcomeMessage, Toast.LENGTH_LONG);
}
}
}
However, I am getting "Resource References are not supported at language level 8".
I checked some threads like this one intellij feature (...) not supported at this language level. I can't compile to figure out where the error could be coming from but I checked both Project JDK versions and Android Studio JRE and they match on "java version 1.8"