# 3.2 Implicit Intents

Implicit intents are used to launch other applications and processes on a user’s device that don’t belong to the same project when the exact destination is unknown.&#x20;

They declare a general action to perform and have the Android system itself take care of it. This includes the extremely common use of launching the default browser to open a link or clicking on the share icon to open any messenger app. These implicit intents are best used to enact functionality that your app itself does not contain.

In our example, we'll be creating a simple share feature. You'll notice that we create an `Intent` object, much like with explicit intents. We set the action of the intent, which in this case is a "send" action. There are many other options for actions, and Google provides a comprehensive list in their documentation. We also set the information to be sent and the information type.&#x20;

```kotlin
var sendIntent = Intent()
sendIntent.action = Intent.ACTION_SEND
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage)
sendIntent.type = "text/plain"
// Verify that there is at least one app that can receive this action
if (sendIntent.resolveActivity(packageManager) != null) {
    startActivity(sendIntent)
}
```

### Sending Data Through Intents

Sometimes it is necessary to pass information from one activity to another -- this is also done with intents. Notice in the above example how we can attach key-value pairs to our intent in the same Activity in which we declare the Intent, using the method `putExtra(key, value)` . This stores all of our data in something called a `bundle`!

When a `ACTION_SEND` request is made by the system, the phone's system will search through all applications on the device and open up a list of ones that are capable of receiving this action (e.g., Gmail, Messenger, Google Drive can all receive `ACTION_SEND` intents) and the user can select one of the choices.&#x20;

Intents give us a lot more functionality to create a positive experience for our user. Not only can we create and switch between multiple screens with explicit intents, but we can allow our user to easily navigate to specific applications with pre-filled data from the intent extras (like opening Google Maps with specific coordinates already filled in).&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://android-course.cornellappdev.com/chapters/3.-intent-and-manifest/3.3-explicit-intents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
