This only happens after the activity has been in the background for some time. It does not happen if I press the "home" button and then a few seconds later reopen the app, restoring the previous state. It does happen when I press the"home" button and then maybe an hour later reopen the app, trying to restore the previous state.
I think the WIN DEATH is causing it. I think it's the activity being garbage collected, but I'm not sure why it doesn't just restart.
Any insights into why this is happening?
note: Game implements Parcelable
05-22 20:43:14.343 I/ActivityManager(401): Start proc com.example.test for activity com.example.test/.ui.MainActivity: pid=12767 uid=10117 gids={50117, 3003, 1028} 05-22 20:48:22.914 I/ActivityManager(401): 43942 kB: com.example.test (pid 12767) 05-22 20:48:22.914 I/ActivityManager(401): 12767 62632K 62488K 44006K 40068K com.example.test 05-22 20:58:39.593 I/WindowState(401): WIN DEATH: Window{41b13370 u0 com.example.test/com.example.test.ui.MainActivity} 05-22 20:58:39.593 I/ActivityManager(401): Process com.example.test (pid 12767) has died. 05-23 11:12:25.469 I/ActivityManager(401): Start proc com.example.test for activity com.example.test/.ui.MainActivity: pid=6450 uid=10117 gids={50117, 3003, 1028} 05-23 11:12:25.696 E/AndroidRuntime(6450): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.ui.MainActivity}: java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.util.ArrayList[] 05-23 11:12:25.696 E/AndroidRuntime(6450): at com.example.test.model.Game.(Game.java:241) 05-23 11:12:25.696 E/AndroidRuntime(6450): at com.example.test.model.Game.(Game.java:235) 05-23 11:12:25.696 E/AndroidRuntime(6450): at com.example.test.model.Game$1.createFromParcel(Game.java:228) 05-23 11:12:25.696 E/AndroidRuntime(6450): at com.example.test.model.Game$1.createFromParcel(Game.java:1) 05-23 11:12:25.696 E/AndroidRuntime(6450): at com.example.test.ui.MainActivity.onCreate(MainActivity.java:237) 05-23 11:12:25.798 W/ActivityManager(401): Force finishing activity com.example.test/.ui.MainActivity 05-23 11:12:26.352 W/ActivityManager(401): Activity pause timeout for ActivityRecord{4161a520 u0 com.example.test/.ui.MainActivity} 05-23 11:12:27.438 I/ActivityManager(401): Process com.example.test (pid 6450) has died.