I. Broadcasting priority ORDER
There are two important elements of Android broadcast:
1 broadcast -for sending broadcasts
Orderly broadcast-received by the broadcast receiver, can be terminated , unable to continue to communicate. Typical representative: SMS Broadcast
Normal broadcast-a broadcast receiver that is sent to each registered (subscribed), cannot be terminated. Typical representative: Start-up broadcast
2 broadcast receivers -to receive broadcasts after a subscription to a broadcast
Static registered broadcast-set in Androidmanifest.xml, the program does not need to start and can receive. Typical representative: A lot of start-up apps, are receiving start-up broadcast with the service.
Dynamic registration of broadcasts-broadcasts are registered in the code and cannot be received when the program is not started. Typical representative: Go SMS, will be forced to stop the go SMS, go SMS can not receive text messages.
Broadcast registration process
Receive broadcast sequence process
In the Activitymanagerservice processing broadcast, when broadcast is an orderly broadcast, the dynamic broadcast receiver and the dynamic broadcast receiver are combined to form the final order of sequential broadcast reception. The above-mentioned
Rule 1 SortingFor:1 Priority-high receive first2 static and dynamic broadcast receivers with precedence over3 A dynamic broadcast receiver of the same priority or a static broadcast receiver of the same priority, in the order in which the process is registered in Figure 1. that is, static: First scan is larger than after scanning, dynamic: first registered greater than after registration. When broadcasting is a normal broadcast,
Rule 2 Sortingis: 1 ignores priority, the dynamic broadcast receiver takes precedence over the static broadcast receiver 2
Rule 1 SortingThe 3rd
two. Basic Questions and Answers
who controls the life cycle of the activity? Answer:
who is manipulating this unreliable application stack behind the scenes? Answer:
Why are "programs unresponsive" always popping up sudden and where do they come from?
Why do I have to keep sensitive data in OnPause?
Damn binder, under the Black Veil, are you a man or a woman?
who killed my Service and how can I survive?
what happens to the threads that are still running after the activity is destroyed?
when you press the back key, will you be sure to return to the main screen?
Some people say Looper and Handler, a process can only have a looper is positive?