Can you post the source code for handling activate signal?