Reference

Intents (Android)

An Intent is Android's messaging object for requesting an action—launching an activity, sharing a file, or starting a service. Explicit intents name a target component; implicit intents describe an action the system resolves to a matching app.

Build & packagingAndroid

Intents (Android)

Also known as: android intent, implicit explicit intent, android intents

An Intent is Android's messaging object for requesting an action—launching an activity, sharing a file, or starting a service. Explicit intents name a target component; implicit intents describe an action the system resolves to a matching app.

  • Explicit intents name a target component; implicit intents describe an action the system resolves via intent filters.
  • Sharing files uses ACTION_SEND with a content:// URI from a FileProvider—raw file:// paths throw FileUriExposedException under scoped storage.
  • Intents carry typed extras and flags, and are the mechanism behind deep links and PendingIntent.

Explicit vs. implicit intents

An Intent is a small message object that asks the system to do something. An explicit intent names the exact component to start—`Intent(context, EditActivity::class.java)`—and is used for navigation inside your own app. An implicit intent instead describes an abstract action (an `action`, a `data` URI, and optional `type`/MIME) and lets Android find any installed app whose `<intent-filter>` matches, showing a chooser when several qualify.

Common implicit actions include `ACTION_VIEW` (open content), `ACTION_SEND` / `ACTION_SEND_MULTIPLE` (share), and `ACTION_GET_CONTENT` / the Storage Access Framework's `ACTION_OPEN_DOCUMENT` (pick files). The matching app is resolved from the intent filters declared in each app's manifest.

How a cleaner app hands files to other apps

After a storage cleaner finds large or duplicate media, the user often wants to share or export it. The app builds an `ACTION_SEND` intent with the file's content URI and a MIME type, then calls `startActivity(Intent.createChooser(...))` so the user can pick Photos, a messaging app, Drive, and so on.

Because of scoped storage, you can't put a raw `file://` path in an intent—doing so throws a `FileUriExposedException`. Instead apps grant temporary read access by sharing a `content://` URI via a FileProvider and setting `FLAG_GRANT_READ_URI_PERMISSION`, so the receiving app can read just that file without broad storage permission.

Extras, flags, and deep links

Intents carry extras—typed key/value data via `putExtra`—and flags that change launch behavior, such as `FLAG_ACTIVITY_NEW_TASK` or `FLAG_ACTIVITY_CLEAR_TOP`. They're also the transport for deep links: an `ACTION_VIEW` intent with an `https`/custom-scheme URI is matched against an activity's intent filter to route the user straight to a specific screen.

Pending forms (`PendingIntent`) let another process—like the notification system or an alarm—fire an intent on your app's behalf later, which is how a 'cleanup finished' notification can reopen the results screen.

Related terms

Keep reading the reference.

Act on it

Guides and tools for this topic.