Preserve state of CrimeFragment when screen is rotated?


#1

Hello,

I just finished the Chapter and the only bug I have is that when I select a crime and then when the CrimeFragment shows up, the app crashes when I rotate the screen.

From the previous chapter I understand that mCrimeId needs to saved in onSavedInstanceState but I cannot find a relevant method to store a UUID ,string pair in the bundle.

Any help is appreciated.

Thanks.


#2

Check your code carefully. Mine is running fine. You probably made a typo somewhere or left out a line.