In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to implement APP adaptation channel notification, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
1. Notification Channel (Channeld)
Of course, the first step in adapting to 8.0 is to upgrade targeSdk to 26. All notifications in 8.0 need to provide notification channels, otherwise, all notifications will not be displayed properly on 8.0.
The following figure shows the display style of APP notification on 8.0 system:
The implementation of APP adaptation channel notification is as follows:
2. Suspension window
8.0 API added a new window type for floating windows, TYPE_APPLICATION_OVERLAY
If the application uses SYSTEM_ALERT_WINDOW permissions and attempts to display a reminder window above other application 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 below windows that use the TYPE_APPLICATION_OVERLAY window type.
If the application adapts to 8.0, the application can only use the TYPE_APPLICATION_OVERLAY window type to create a suspended window. (other window types were obsolete at 8.0)
3. Picture-in-picture mode (new function)
We know that Activity supports split-screen mode by default, but we also need to declare that Activity allows split-screen mode, and add support for picture-in-picture mode:
When an App page switches from full-screen mode to picture-in-picture mode, its Activity life cycle also goes through the process of being destroyed and rebuilt. 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 playback in the onPause method, but should pause the playback in the onStop method and resume the video playback in the onStart method
Enter picture-in-picture mode:
4. Adaptive icon
Android 8.0 introduces an adaptive initiator icon that can be displayed in a variety of shapes on different device models and is created as follows:
Then click Next, then finish directly, and finally use it in application:
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.