Android Interview Questions and Answers What is android?


BroadcastReceivers And Ordered Broadcast Intents



Download 0.77 Mb.
View original pdf
Page48/62
Date17.12.2020
Size0.77 Mb.
#54986
1   ...   44   45   46   47   48   49   50   51   ...   62
Android Interview Questions
8.2.1 BroadcastReceivers And Ordered Broadcast Intents
The BroadcastReceiver class defines a number of methods related to ordered broadcast Intents which can be used by an implementation of the onReceive() method.
8.2.1.1 Determining The Type Of A Broadcast Intent
The public final boolean isOrderedBroadcast() method will return true if the onReceive()method has been invoked with an ordered broadcast Intent.
8.2.1.2 Getting The Ordered Broadcast Intent Result Data
The methods public final int getResultCode() public final String getResultData() public final Bundle getResultExtras(boolean makeMap)
will return the current values of the code data extras respectively. If the code is not defined then the default value is -1. If the data is not defined then the default value is null.

If the extras are not defined then the default value is null unless the makeMap argument is true in which case an empty Bundle is created and returned. These methods can be called when the onReceive() method was not invoked on an ordered broadcast Intent and they will return the default values as above.

Download 0.77 Mb.

Share with your friends:
1   ...   44   45   46   47   48   49   50   51   ...   62




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

    Main page