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

Source: Internet
Author: User

When I use an app today, I suddenly find a pull-up menu. Program video Throw in play, gee! Aroused my interest.

First, the two methods are listed, and the first method is the proxy for the appdelegate. Called when the program enters the background
-(void) Applicationdidenterbackground: (uiapplication *) application Ns_available_ios (4_0);
The second method is. Register system notification, name is uiapplicationwillresignactivenotification, 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 procedures to get 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: just call applicationwillresignactive. If you click on another program, then other programs into the foreground, the app calls Applicationdidenterbackground
3. Pull-up, drop-down menu, program still in foreground: just call applicationwillresignactive

In the "NetEase News" app to watch the video, "NetEase video" is only the first situation to deal with. The video is paused, and the remaining situation is not processed and 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 turning on the flashlight, turning on WiFi, turning off rotation, and so on.

Do not want the rear video to stop. There are some apps on the market today. For these three kinds of situations are first suspended, the front office to restore, but the visual will still card.

(Ready to be intact)

The IOS program enters the background, including the user pull-up shortcut menu causes 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.