I am developing a sign language translation app following this playlist.
I am encountering the following errors:
Cannot resolve method ‘startActivity(Intent)’
Cannot resolve constructor ‘Intent(MainActivity, Class)’
Cannot resolve constructor ‘Intent(MainActivity, Class)’
Here is the relevant code snippet:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
camera_button = findViewById(R.id.camera_button);
camera_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, CameraActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP));
}
});
combine_letter_button = findViewById(R.id.combine_letter_button);
combine_letter_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, CombineLettersActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP));
}
});
}
I have tried changing the Gradle and JDK versions, but the issue persists. A friend working with me on this project also attempted to resolve it, but we haven’t been successful.
Any assistance would be greatly appreciated. Thank you for your time and help.