Android Interview Questions and Answers What is android?



Download 0.77 Mb.
View original pdf
Page52/62
Date17.12.2020
Size0.77 Mb.
#54986
1   ...   48   49   50   51   52   53   54   55   ...   62
Android Interview Questions
8.3.1 Example One
Sending an ordered broadcast Intent which is handled by all the registered BroadcastReceivers. This example illustrates the delivery of the broadcast Intent to the BroadcastReceivers in priority order, and the use of result data
8.3.1.1 Stage One Sending The Intent
The Intent is sent as follows sendOrderedBroadcast( new Intent
"xper.example.ORDERED_BROADCAST_INTENT"), null, new ResultReceiver(), null,
0,
"ExampleOne", null
8.3.1.2 Stage Two The Broadcast Intent Is Received By OrderedBroadcastReceiverThree
The OrderedBroadcastReceiverThree.onReceive() method prints
Three
Intent { act=xper.example.ORDERED_BROADCAST_INTENT cmp=xper.example.three/.OrderedBroadcastReceiverThree } getResultCode() => 0

getResultData() => ExampleOne
Three done

Download 0.77 Mb.

Share with your friends:
1   ...   48   49   50   51   52   53   54   55   ...   62




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

    Main page