BroadcastReceiver small test

Introduction to this section

In this section, we will learn the third of the four major components of Android: BroadcastReceiver (broadcast receiver), ok, let's start this section.

PS: By the way, on the Android official website, click on API Guides -> App Components and find no trace of BroadcastReceiver, then directly search for BroadcastReceiver, the corresponding document address: BroadcastReceiver

1. What is BroadcastReceiver?

Broadcast literally translates to broadcast. Let’s give an example to help me understand BroadcastReceiver. I remember that when I was studying in the past, each class would have a big speaker hanging on the wall to broadcast some notifications. For example, I have to move books when school starts. , broadcast: "Each class finds a few students in the Academic Affairs Office to pick up books", after sending out this broadcast, all students will receive this broadcast notification at the same time, received, but not every student will move books, generally go to Those who move the books are all "hercules" in the class. After receiving this broadcast, this group of "hercules" will set off to move the books back!

——Well, the above is a very vivid example of a broadcast transmission: big speakers—

Guess you like

Origin blog.csdn.net/shiwei0813/article/details/130162713