Can't compile


After created “fragment_crime.xml” successfully and when try to fill CrimeListFragment, “the” is not found, only crime_solved, crime_title and crime_date are found. I rechecked several times the code, but it’s the same as the book. What could be the error?

Best regards,


Error found!!
there was a space between < and… in fragment_crime_list.xml. After run grade sync, I found it.


I am using the below code:
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;

It gives error in Crime c = getItem(position); line.
The error is: Cannot reslove method getItem(int).

Please help me out.


public class CrimeListFragment extends Fragment {
private RecyclerView mCrimeRecyclerView;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_crime_list, container, false);
mCrimeRecyclerView = (RecyclerView) view
mCrimeRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
return view;

–Note that as soon as you create your RecyclerView, you give it another object called a LayoutManager.
RecyclerView requires a LayoutManager to work. If you forget to give it one, it will crash.

I got stuck here please help me out.If i compile this one it will get crashed.The bold one which i cant understand can you please help me