Start a service that starts a notification in the service. The notification is downloaded.
multiple uses of Android notification
http://blog.csdn.net/loongggdroid/article/details/17616509
Android Multi-task download, use Notification update progress bar:
http://cn23snyga.iteye.com/blog/1902071
Android4.1: The notification bar displays clickable buttons-notification.builder Sample:
Http://blog.sina.com.cn/s/blog_7189b2fc010193at.html
Notification Implementation download progress display!
http://blog.csdn.net/jacklam200/article/details/7445990
notification use of the third: Update progress notification via service & Monitor Service progress in activity
http://blog.csdn.net/liuhe688/article/details/6623924
Android uses service services to create title bar notifications
Http://www.2cto.com/kf/201310/249934.html
Android Implementation service background download notification progress bar
http://blog.csdn.net/cynhafa/article/details/6613001
communication between Android service and activity and notification
Activity registers a broadcast in OnCreate, which is used to update the message and OnStop when it is unregistered.
Add a flag, change when activity is created and destroyed, and send notifications in service.
Ask
The 2nd is not very understand, also please detailed point!
Reply
For example, if you define a global variable bool send_notification=false,activity is destroyed, it will send_notification=true. So you are in service, if send_notification=true send NOTIFICATION. This is a method.
You can also register two broadcastreceiver, receive the same action, in fact, is an orderly broadcast. A registration at Activityoncreate, Activity ondestory (or OnStop) unregister, this broadcast to update the interface message, higher priority, update the interface in OnReceive Abortbroadcast , and then register a broadcast that sends notification, which has a lower priority, and can then use Context.sendorderedbroadcast to send an action broadcast. This way, if your interface is in the real world, a high-priority refresh message is called, and then abort is dropped. If your interface is no longer displayed, a low-priority send notification is called.