O'Reilly logo

Learning Android Intents by Wajahat Karim, Muhammad Usama bin Aftab

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending and receiving custom broadcasts

Until now, we have been only receiving broadcasts. And all those intents we have experimented with are the Android System broadcasts. In this section, we will talk about custom broadcasts. We will see how we can send our own custom broadcasts to other applications and how other applications can listen for our custom broadcast intents.

In the next section, we will create an example that will send custom broadcasts to other applications. Let's create the activity and layout file for the application now.

The activity_main.xml layout file

The activity_main.xml file represents the layout file of our activity. The following code shows the implementation of the manifest file:

As you can see in the layout file, we have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required