CrimeId in details view not getting updated properly


Hi ,
Awesome book … I like it very much.

My problem is that "If i click crime #1 or crime #2 or anyother crime in the listview " In the details view i am getting output only as “Crime #0
public void onListItemClick(ListView l,View v,int position,long id ){

	Crime c =((CrimeAdapter)getListAdapter()).getItem(position);
	Intent i = new Intent(getActivity(),CrimeActivity.class);
	i.putExtra(CrimeFragment.EXTRA_CRIME_ID, c.getId());
	Toast.makeText(getActivity().getApplicationContext(), c.getTitle().toString(), Toast.LENGTH_SHORT).show(); -->[b]Here it shows the c.getTitle() being passed as the correct crime[/b] 

public View onCreateView(LayoutInflater inflater,ViewGroup parent,Bundle savedInstanceState){

	View v = inflater.inflate(R.layout.fragment_crime, parent,false);
	mTitleField = (EditText)v.findViewById(;
	Toast.makeText(getActivity().getApplicationContext(), mCrime.getTitle().toString(), Toast.LENGTH_SHORT).show(); --> This one shows crime #0


I guess the reason is that you did not get correct crime id in onCreate function in like this:

[code] @Override
public void onCreate(Bundle savedInstanceState) {

    UUID crimeId = (UUID)getArguments().getSerializable(EXTRA_CRIME_ID);
    mCrime = CrimeLab.get(getActivity()).getCrime(crimeId);

but you don’t show you all code.