Android Interview Questions and Answers What is android?


The Dynamic BroadcastReceiver Lifecycle



Download 0.77 Mb.
View original pdf
Page44/62
Date17.12.2020
Size0.77 Mb.
#54986
1   ...   40   41   42   43   44   45   46   47   ...   62
Android Interview Questions
5.2 The Dynamic BroadcastReceiver Lifecycle
The lifecycle of a dyamically registered BroadcastReceiver is under the control of the Application. An Application can create BroadcastReceivers and register and unregister them as and when it chooses. There are no constraints on the functionality that can be used by the implementation of the onReceive() method of a dynamically registered BroadcastReceiver.
6. BroadcastReceivers And Intent Resolution
If an Intent explicitly specifies a component then the Intent resolves to that Component if it is a
BroadcastReceiver. If the specified Component is not a BroadcastReceiver it is equivalent to the case where the Intent cannot be resolved to any BroadcastReceiver(s). Otherwise a search is made for all BroadcastReceivers with an associated IntentFilter which matches the given Intent, as defined by the
IntentFilter.match()
method. If the Intent specifies a package then the search is confined to the Services in that Application package. An Application can determine the BroadcastReceivers to which a given Intent resolves by using an implementation od the android.content.pm.PackageManager public abstract List queryBroadcastReceivers (Intent intent, int flags) The list is sorted in order from high to low priority as defined by the associated IntentFilters.

Download 0.77 Mb.

Share with your friends:
1   ...   40   41   42   43   44   45   46   47   ...   62




The database is protected by copyright ©ininet.org 2024
send message

    Main page