ClassCastException


#1

Hello, app is crashing when I choose crime from a list

Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.util.UUID
at com.ooky.criminalintent.CrimeFragment.onCreate(CrimeFragment.java:30)

UUID crimeId = (UUID)Objects.requireNonNull(getActivity()).getIntent().getSerializableExtra(CrimeActivity.EXTRA_CRIME_ID);
mCrime = CrimeLab.get(getActivity()).getCrime(crimeId);

How to solve this problem?