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)