Android Interview Questions and Answers What is android?


Stage Six ResultReceiver onReceive() Method Called



Download 0.77 Mb.
View original pdf
Page54/62
Date17.12.2020
Size0.77 Mb.
#54986
1   ...   50   51   52   53   54   55   56   57   ...   62
Android Interview Questions
8.3.1.6 Stage Six ResultReceiver onReceive() Method Called
The ResultReceiver.onReceive() method prints
ResultReceiver
Intent { act=xper.example.ORDERED_BROADCAST_INTENT } getResultCode() => 341 getResultData() => ExampleOne, Three, TwoA, TwoB, One
Begin Extras
Three.value
=> Three
TwoB.value
=> TwoB
TwoA.value
=> TwoA
One.value => One


End Extras
ResultReceiver done
8.3.2 Example Two
Sending an ordered broadcast Intent which is handled by all the registered BroadcastRecivers but one of them stops the sending process.
8.3.2.1 Stage One Sending The Intent
The Intent is sent as follows sendOrderedBroadcast( new Intent
"xper.example.ORDERED_BROADCAST_INTENT_TWO"), null, new ResultReceiver(), null,
0,
"ExampleTwo", null
8.3.2.2 Stage Two The Broadcast Intent Is Received By OrderedBroadcastReceiverThree
The OrderedBroadcastReceiverThree.onReceive() method prints
Three
Intent { act=xper.example.ORDERED_BROADCAST_INTENT_TWO cmp=xper.example.three/.OrderedBroadcastReceiverThree } getResultCode() => 0 getResultData() => ExampleTwo
Three done
8.3.2.3 Stage Three The Broadcast Intent Is Received By OrderedBroadcastReceiverTwoA
The OrderedBroadcastReceiverTwoA.onReceive() method prints
TwoA
Intent { act=xper.example.ORDERED_BROADCAST_INTENT_TWO cmp=xper.example.two.a/.OrderedBroadcastReceiverTwoA } getResultCode() => 300 getResultData() => ExampleTwo, Three
TwoA done and stops the sending of the broadcast Intent.

Download 0.77 Mb.

Share with your friends:
1   ...   50   51   52   53   54   55   56   57   ...   62




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

    Main page