What is the difference between an explicit and implicit Intent?
Explain how Android chooses the destination of an Intent and when to use each form.
What the interviewer is testing
The interviewer is checking whether you understand that the difference is not simply “internal versus external.” It is about how the target component is selected.
A strong answer explains Android's resolution process, knows when a chooser improves user control, and recognises that intent filters and exported components create an inter-app entry point with security implications.
❌ Common mistake
If they ask you to elaborate
A useful shortcut is to ask: do I own and know the destination? If yes, use an explicit Intent. If not, describe the capability and let Android resolve it.
| Question | Explicit Intent | Implicit Intent |
|---|---|---|
| Who chooses the destination? | Your app | Android |
| Common use | Navigate to a known component | Delegate a capability |
| Real-world example | Open OrderDetailsActivity | Share an article or open a map |
| Intent filter required for targeting? | No | The receiving component needs a compatible filter |
| Possible result | The named component starts or the request fails | Zero, one, or multiple apps may match |
Common examples:
| Scenario | Use | Why |
|---|---|---|
Open SettingsActivity in your app | Explicit | The destination is known |
Navigate to OrderDetailsActivity | Explicit | Your app owns the screen |
| Open a website or map location | Implicit | Any capable app may handle it |
| Share an article | Implicit | The user may choose a messaging, email, or social app |
| Capture a photo with another camera app | Implicit | You are requesting a capability, not a specific component |
An explicit Intent supplies a concrete component, while an implicit Intent supplies matching information such as an action and data.
For an Activity, Android compares the Intent's action, data, MIME type, and categories against registered intent filters. If more than one app is eligible, the system may use the user's existing default. Use Intent.createChooser() when choosing the receiving app is part of the user action—for example, sharing content.
Do not assume “implicit” means “outside your app.” A component in your own app can match an implicit Intent, although explicit targeting is normally clearer and safer for internal navigation. Conversely, an explicit Intent can target another app when its component is known and accessible.
Code example
fun Activity.openSettings() {
// Explicit: this app knows and owns the destination.
startActivity(Intent(this, SettingsActivity::class.java))
}
fun Activity.shareArticle(articleUrl: Uri) {
// Implicit: describe the capability and let Android find handlers.
val sendIntent = Intent(Intent.ACTION_SEND).apply {
type = "text/plain"
putExtra(Intent.EXTRA_TEXT, articleUrl.toString())
}
val chooser = Intent.createChooser(
sendIntent,
getString(R.string.share_article)
)
try {
startActivity(chooser)
} catch (_: ActivityNotFoundException) {
Toast.makeText(this, R.string.no_share_app, Toast.LENGTH_SHORT).show()
}
}The first function uses an explicit Intent because the destination is a known screen owned by the app. The second describes the capability—sharing plain text—without naming an application, and a chooser lets the user select the receiving app.
An implicit Activity Intent may resolve to zero, one, or multiple handlers. Handle failure rather than assuming another app is installed, and treat data received from external Intents as untrusted input.
Follow-up questions
What separates a senior answer
Key takeaways
Learn more
Can you describe the Fragment lifecycle and Fragment view lifecycle?
Explain why a Fragment and its view have different lifetimes, and how that affects UI work and cleanup.
What is a PendingIntent and why is it needed?
Explain how Android lets another process perform a predefined action later on your app's behalf.