User Activity

I know that they can not be used at the same time. But how can you switch between CAN and USB at runtime in the same application?