-
Notifications
You must be signed in to change notification settings - Fork 0
Android 常驻Service
ythy edited this page Oct 20, 2017
·
3 revisions
For Android 2.0 or later you can use the startForeground() method to start your Service in the foreground.
A started service can use the startForeground(int, Notification) API to put the service in a foreground state,where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice this should not be a concern.)
You'll need to supply a Notification to the method which is displayed in the Notifications Bar in the Ongoing section.
tell me how get back to sunshine