I want to put an icon in the status bar when ever my application is running, including when it is running in the background. How can I do this?
◎위챗 : speedseoul
http://stackoverflow.com/questions/3973208/icon-in-the-status-bar-when-application-is-running
http://stackoverflow.com/questions/8835518/displaying-an-icon-in-status-bar-when-my-task-is-running
6 4 | I want to put an icon in the status bar when ever my application is running, including when it is running in the background. How can I do this? | |||
1 | Take a look at the Dev Guide "Creating Status Bar Notifications". One way to achieve the goal of keeping the icon there only when the application is running is to initialize the notification in An example:
| ||
Application
class is probably the best place for the code since it persists throughout the life of the application. Clearing the notification will be difficult because the system may arbitrarily decide to kill an app's process under conditions of low memory. You might try creating a service to monitor the status since the system will try to restart the service later when more memory is available. – Brian Oct 20 '10 at 4:34