I have an activity and a fragment. The fragment's java file is currently empty. Below is the code for my activity
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class CrimeActivity extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crime);
}
}
When I try running my app, the error message is
Error:(15, 9) error: cannot find symbol method setContentView(int)
is I have tried searching for an answer but to no avail. I have cleaned my project and restarted Android Studio thrice. There are also no errors in the XML files.