For example, here's how you can add an extra with key message and value Hello: intent.putExtra("message", "Hello") 6.
![setcomponent intent android studio setcomponent intent android studio](https://img2018.cnblogs.com/blog/1779541/201910/1779541-20191022230942804-297335929.png)
To add an extra to an Intent object, you can use the putExtra() method.
![setcomponent intent android studio setcomponent intent android studio](https://i.ytimg.com/vi/vPnqfhQPZe0/maxresdefault.jpg)
Intents can either be explicit or implicit. It is able to start when you touch its icon only because it is able to respond to an intent created by the launcher app on your device.Īlong with details about the activity, an intent can contain additional data, aptly called extra data, to send arguments or return results from one activity to another. For example, consider the Hello World app you created earlier in this series.
![setcomponent intent android studio setcomponent intent android studio](https://i.ytimg.com/vi/kknBxoCOYXI/maxresdefault.jpg)
They are such an integral part of the Android platform that even the simplest of apps need them. Intents are instances of the Intent class. To start an Android activity, you must have an intent for it. The same is true in the world of Android apps. In the real world, before you start performing an action, you usually intend to perform it.