Today in the use of an app, suddenly found pull-up menu, program video thrown in the play, Gee! Aroused my interest.
First, list two methods, the first method is the agent of Appdelegate, when the program enters the background call
-(void) Applicationdidenterbackground: (uiapplication *) application Ns_available_ios (4_0);
The second method is to register the system notification, name is Uiapplicationwillresignactivenotification, which is called when the program releases active.
[[Nsnotificationcenter Defaultcenter] addobserver:self selector: @selector (applicationwillresignactive:) Name:uiapplicationwillresignactivenotification Object:nil];
Developers need to implement
-(void) Applicationwillresignactive: (uiapplication *) application
Here are a few common programs that go into the background, or lose an active operation. 1. Click the Home button, the program goes backstage: Call Applicationwillresignactive First, then call Applicationdidenterbackground
2. Double-click the Home button, the program into the Task Manager: only call applicationwillresignactive. If you click another program, then other programs enter the foreground, this app calls Applicationdidenterbackground
3. Pull-up, drop-down menu, program still in foreground: only call applicationwillresignactive
In the "NetEase News" app to watch the video, "NetEase video" just for the first situation to deal with, that is, pause the video, and the rest of the situation is not processed, the video continues to play.
This should be the user interaction refinement, arouse my interest. Sometimes, I just use the pull-up shortcut menu to do some simple switches, such as: Turn on the flashlight, turn on WiFi, turn off rotation, and so on. Do not want the rear video to stop. Now there are some apps on the market, for these three kinds of situations are first suspended, the front office resumed, but the visual will still be stuck .
(To be perfected)
The IOS program enters the background, including the user pull-up shortcut menu causing the program to lose active research