iPhone How to programmatically handle SMS/Call alert notification
I'm having some problems with SMS alerts and call notification freezing up the video 开发者_运维知识库player. I'm currently displaying a video using MPMoviePlayerController with movieControl Hidden. I'm also overlaying a subtitle using UITextView on top of the video.
However whenever a SMS alert popup, the video will freeze up but the textView will continue to scroll. A call alert will also intrupt the video, causing the video to freeze up while the text continue scrolling, which leads to misallignment.
So is there any way to fix the video from freezing up? Or is there any way to detect SMS/Call alert notifications and handle it?
check
- (void)applicationWillResignActive:(UIApplication *)application
and
- (void)applicationDidBecomeActive:(UIApplication *)application
methods of UIApplicationDelegate protocol. Or you can catch
UIApplicationDidBecomeActiveNotification
and
UIApplicationWillResignActiveNotification
notifications
精彩评论