Listing 11.7 - Null Pointer Exception when swiping


I have got a Null Pointer Exception when swiping fragments. Here is a fragment of the code:

public Fragment getItem(int pos) {
	UUID crimeId = (UUID) getIntent().getSerializableExtra(CrimeFragment.EXTRA_CRIME_ID);
	Crime crime = mCrimes.get(pos);
      for (int i=0;i<mCrimes.size();i++){
				return CrimeFragment.newInstance(crime.getId());	

any help is appreciated


That is not the code that I see for Listing 11.7 in the book.


oops, you are perfectly right, I misplaced some code!!
Thank you!!!