1. Which method can send a broadcast?
Activity.sendbroadcast or Context.sentbroadcast or service.sendbroadcast
2. Must the class be inherited by the creation of a broadcast acceptance program?
Broadcastreceiver
3. What are the parameters of the broadcast acceptance procedure?
public void OnReceive (context context, Intent Intent)
The Context in which the receiver is running
The Intent being received
4. How do I register for a broadcast acceptance procedure?
<receiver android:name= "Com.htc.globalsearch.imagesearch.service.provider.ImageSearchReceiver" android:exported= "false" > <intent-filter> <action android:name= " Com.htc.intent.action.REBUILDIMAGE "/> </intent-filter> <intent-filter> <action Android:name= "Android.intent.action.BOOT_COMPLETED"/> </intent-filter> </receiver>
5. How do you point out that you are interested in feature broadcasts? </intent-filter>
6. Can external programs receive broadcasts?
The reception of the broadcast to see Intent-filter and permission, to satisfy this is acceptable.
7. How do I access the Notification Manager?
Mnotificationmanager = (Notificationmanager)this.getsystemservice (Notification_service);
What is the goal of 8.Intentservice?
Intentservice is a service that starts by Context.startservice (Intent) to handle asynchronous requests, and you only need to inherit intentservice and override them when you use the The Onhandleintent (Intent) method receives a Intent object and stops itself at the appropriate time (usually when the job is completed). All requests are processed in one worker thread, alternating (but not blocking the execution of the main thread), and only one request can be executed at a time.
That is, Intentservice initiates a service and starts the threading process without blocking the main thread.
Intentservice is actually a collection of looper,handler,service, he has not only the function of service, but also the function of processing and looping messages.
14. There are many clients calling Intentservice, so what is the thread corresponding to the client?
1 of them. All operations are performed within one thread. Ensure synchronization through Looper,handle mechanism!
Service to handle complex tasks, you can loop through the thread in Looper,handler Way, and then connect the remote service by AIDL.
What is 15.wakefulintentservice?
Broadcast of Android four components (cont.)