Changes

Jump to: navigation, search

Android 6 Broadcast Intents and Broadcast Receivers

15 bytes removed, 07:42, 28 January 2016
m
Text replacement - "<google>BUY_ANDROID_STUDIO6</google>" to "<htmlet>androidstudio_a6</htmlet>"
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
</manifest>
</pre>
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
The same effect can be achieved by registering the broadcast receiver in code using the registerReceiver() method of the Activity class together with an appropriately configured IntentFilter object:
Note that, in this instance, the action string for the intent is com.ebookfrenzy.sendbroadcast. When the broadcast receiver class is created in later sections of this chapter, it is essential that the intent filter declaration match this action string.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
This concludes the creation of the application to send the broadcast intent. All that remains is to build a matching broadcast receiver.
With the manifest file completed, the broadcast example is ready to be tested.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
== Testing the Broadcast Example ==
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>

Navigation menu