Implemented saving/restoring state for activity