The IOS program enters the background, including the user pull-up shortcut menu causing the program to lose active research

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.