How to get a PERMANENT application notifier in the status bar?

旧时模样 提交于 2020-01-12 03:37:26

问题


I searched on the Internet alot but cant find a proper answer to this.

I have used apps like 3G watchdog and Advanced task killer on my android phone. I noticed that they always have an icon up when the status bar is minimized and also have a notification( Upon clicking opens the app) which cant be cleared from the status bar.

I like to use something like this in my app.

I know how to get an image and everything in the status bar, but how to keep one that cant be cleared till my app is running in the background and is not explicitly turned off is a problem.

Please Help.Thanks.


回答1:


You can do this by setting FLAG_ONGOING_EVENT and FLAG_NO_CLEAR flags to your notification. More info from here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html



来源:https://stackoverflow.com/questions/4983032/how-to-get-a-permanent-application-notifier-in-the-status-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!