Issue with Listing 9.6



I went through chapter 9 without much trouble, then I got through most of chapter 10 and was having trouble get the title to display when I clicked a crime. I went back through the code to see if I made a mistake.

I found a typo on line
mCrimes = CrimeLab.get(getActivity()).getCrimes(); (listing 9.6)

I had
mCrimes = CrimeLab.get(getActivity()).getmCrimes();

when I corrected

.getmCrimes to .getCrimes

I get an error that says "cannot resolve method getCrimes();

I am not sure what I have done wrong. Any help would be great.


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 onListItemClick(ListView l, View v, int position, long id) {
    Crime c = ((CrimeAdapter)getListAdapter()).getItem(position);

    //start crime activity
    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)convertView.findViewById(;
        TextView dateTextView = (TextView)convertView.findViewById(;
        CheckBox solvedCheckBox = (CheckBox)convertView.findViewById(;

        return convertView;



What do you have in ?

It should have among other things

public ArrayList<Crime> getCrimes() {
		return mCrimes;