Android8.0 adaptation that point (i)

Source: Internet
Author: User

1. Notification channel (Channeld)

Of course, the first step to match 8.0 is to upgrade the TARGESDK to 26, in 8.0 all notifications are required to provide notification channels, otherwise, all notifications on the 8.0 system can not display properly;

Is the display style of the app notification on the 8.0 system:

App adaptation channel notifications are implemented as follows:

2. Suspended window

The 8.0 API has a new window type for floating windows, Type_application_overlay;

If your app uses System_alert_window permissions and tries to display a reminder window above other apps and system windows using one of the following window types:

Type_phone
Type_priority_phone
Type_system_alert
Type_system_overlay
Type_system_error
Type_toast

These windows will always appear under windows that use the Type_application_overlay window type.
If the app fits 8.0, the app can only use the Type_application_overlay window type to create a floating window. (Other window types have been discarded in 8.0)

3. Picture in picture mode (new function)

We know that activity is supported by default in Split-screen mode, but we also need to declare activity to allow split-screen, and then add support for PIP mode:

The app page switches from full screen mode to pip mode, its activity life cycle also undergoes the process of rebuilding after destruction, and if the developer wants to keep the app page from being rebuilt, add the following attribute description to the Activity node of the page:

Android:configchanges= "Srceenlayout|orientation"

For the video playback page, the activity code also does not pause the video in the OnPause method, but should pause the playback in the OnStop method and resume playing the video in the OnStart method;


Enter PIP mode:

4. Self-adapting icon

Android 8.0 introduces an adaptive launcher icon that can be displayed on different device models in a variety of shapes, created as follows:

Then click Next to finish directly, and finally use in application:

Conclusion

You crossing, do not walk away, your message, your praise, is my driving force, followed by the start Page adaptation, version update adaptation and other functions of the detailed elaboration; if there is an error in the text, please comment and discuss together.

Android8.0 adaptation that point (i)

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.