I noticed that when I make changes to the Crime data it is resistant to rotations of the screen, and wanted to confirm that I understand why this is happening.
Because CrimeLab is a singleton its class data which includes the mCrimes arraylist stays as long as the application is loaded in memory. So even though the activities are being taken down (Destroy) and rebuilt (Create), the application’s context is still in place so the singleton data is preserved across rotations.
I also tried rotating while in the fragment, and this too resists rotations because as the Listeners (for text activity and checkbox activity) are called when the user interface of the fragment is utilized, they store the change into the CrimeLab mCrimes structure immediately, so for the same reason (singleton) there are no issues for rotation change etc.
Just wanted to confirm this - if this is indeed the case when would the application’s context actually go away (and your singleton data)?