Listing 10.8, 'method does not override' error


When I follow listing 10.8 and override ‘onResume()’ in CrimeListFragment I’m told that the method does not override or implement a method from a supertype.

Ca nsomeone please help me figure this out?


One possibility is the JDK version you have Eclipse set to use. Seems this may happen if set to 1.5 rather than 1.6. Have a look at this Stackoverflow question and see if it pertains to your case:


No, this is not the case. 1) I’m not using Eclipse, 2) I only have one JDK installed and it’s 1.8.


OK, if you’re sure the signature of the overridden method exactly matches that of the parent class, then I guess I’m fresh out of ideas of what the problem might be.


Here’s my code for as of the listing for 10.8. Note the bit for onResume(), which is the part with the error.


import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;

public class CrimeListFragment extends ListFragment {
private static final String TAG = “CrimeListFragment”;
private ArrayList mCrimes;

public void onCreate(Bundle savedInstanceState) {
mCrimes = CrimeLab.get(getActivity()).getCrimes();

   CrimeAdapter adapter = new CrimeAdapter(mCrimes);


public void onRusume() {

public void onListItemClick(ListView l, View v, int position, long id) {
    Crime c = ((CrimeAdapter)getListAdapter()).getItem(position);

    //Start CrimeActivity
    Intent i = new Intent(getActivity(), CrimeActivity.class);
    i.putExtra(CrimeFragment.EXTRA_CRIME_ID, c.getId());

private class CrimeAdapter extends ArrayAdapter<Crime> {
    public CrimeAdapter(ArrayList<Crime> crimes) {
        super(getActivity(), 0, crimes);

    public View getView(int position, View convertView, ViewGroup parent) {
        // If we weren't given a view, inflate one
        if (convertView == null) {
            convertView = getActivity().getLayoutInflater()
                    .inflate(R.layout.list_item_crime, null);

        // Configure the view for this Crime
        Crime c = getItem(position);

        TextView titleTextView =
        TextView dateTextView =
        CheckBox solvedCheckBox =

        return convertView;



If this is the exact code with the error, then take a close look at how your spelled the method name. The compiler is usually always correct  :wink:

If this is the exact code with the error, then take a close look at how your spelled the method name. The compiler is usually always correct :wink:


Oh dammit. Thanks :smiley: