Save and restore only if launched as Activity.