The first line of code--android read the notes broadcast

Source: Internet
Author: User
Broadcast Receivers 1. Registration method Dynamic Registration: Registration in the program, such as in the activity of the OnCreate () method registered static registration: Androidmanifest.xml Registration 2. What broadcast receive system messages can be received: such as network status changes, system completion startup, Battery status Receive app message: such as SMS call Notification 3. Use caution does not allow time-consuming operations in the OnReceive method, does not allow startup of new threads generally used to start other components, such as service, status bar notification send broadcast 1. Broadcast type by receive: Standard broadcast (default), Ordered broadcast by broadcast range: Global Broadcast (default), local broadcast 2. The sending method can be directly used in the activity Sendbroadcast (), Sendorderedbroadcast () Method 3. Sent what sent a Intent object OnCreate () {... public
void OnClick (View v) {
Intent Intent = new Intent ("com.example.b Roadcasttest. My_broadcast ");
Sendbroadcast (intent);
}...
} Therefore, data can be transmitted as a way of communicating openly between processes. 4. Standard broadcast one-to-many, receiver simultaneously receives 5. Ordered broadcast receivers can be interrupted (intercepted) using Abortbroadcast () in the receiver OnReceive () method, in accordance with the order of priority sequential delivery broadcasts Stop delivery Set priority in Androidmanifest.xml 6. Local broadcast using Localbroadcastmanager (singleton) Sendbroadcast () method send broadcast using LOCALRECEIVER receive broadcast local broadcast can only be registered dynamically

The first line of code--android read the notes broadcast

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.