Fixed to save/restore activity's state.