Save all state in preferences to better handle rotation and relaunch