Register for UIApplicationDidBecomeActiveNotification and UIApplicationWillResignActiveNotification