Replaces and updates an activity