android-kotlin
/

Android Intents – The Native Communication Bridge

Last Sync: Today

On this page

5
0%
5 min read
Remaining
5 minleft

Click any section to jump — progress syncs automatically

android-kotlin

Android Intents – The Native Communication Bridge

What is an Intent?

An Intent is a 'passive' data structure that holds an abstract description of an action to be performed. It acts as the glue between different components—even those in different applications. For your Revochamp project, Intents are the mechanism used to transition from your Flutter UI to a native Android 'Preview' or to share a generated code snippet to an external editor.

  1. Explicit Intents

Explicit intents specify exactly which component (class name) should be started. You use these for internal navigation within your native Android Runner code where you know the exact target class.

KOTLINRead-only
1
// Navigating to a specific native Activity
val intent = Intent(this, AIEditorActivity::class.java).apply {
    putExtra("WIDGET_TYPE", "FAB")
    putExtra("THEME_COLOR", "#007AFF")
}
startActivity(intent)

  1. Implicit Intents

Implicit intents do not name a specific component. Instead, they declare a general action to be performed (e.g., 'view a map' or 'send an email'). The Android system then finds all apps that can handle that action using Intent Filters and lets the user choose. This is vital for Revochamp's 'Export' and 'Share' features.

KOTLINRead-only
1
// Sharing generated code to any available editor app
val sendIntent = Intent().apply {
    action = Intent.ACTION_SEND
    putExtra(Intent.EXTRA_TEXT, "// Generated by Revochamp\nprintln('Hello World')")
    type = "text/plain"
}

val shareIntent = Intent.createChooser(sendIntent, "Export Code To:")
startActivity(shareIntent)

  1. Intent Filters: Receiving Requests

If you want the Revochamp app to open when a user clicks a specific link (Deep Linking), you must declare an Intent Filter in your AndroidManifest.xml. This tells the OS, 'My app is capable of handling this specific type of data or action.'

XMLRead-only
1

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https" android:host="revochamp.com" />
</intent-filter>

Intent Type Comparison

FeatureExplicit IntentImplicit Intent
TargetSpecific Class (Internal)Action Type (System-wide)
Use CaseMoving between your own screensIntegrating with other apps
SecurityHigh (Targets your own code)Lower (Needs 'exported' flag)
FlexibilityLow (Fixed path)High (User chooses the app)
Deep LinkingN/APrimary mechanism

Test Your Knowledge

Q1
of 3

Which type of Intent is used to launch a specific class within your own application?

A
Implicit Intent
B
Explicit Intent
C
Broadcast Intent
D
Service Intent
Q2
of 3

Where are Intent Filters declared to allow an app to handle deep links?

A
build.gradle.kts
B
MainActivity.kt
C
AndroidManifest.xml
D
res/values/strings.xml
Q3
of 3

What happens if an Implicit Intent is fired but no app on the device is registered to handle that action?

A
The system ignores it
B
The app crashes with an ActivityNotFoundException
C
A default Google app opens automatically
D
The device restarts

Frequently Asked Questions

How do I pass large amounts of data through an Intent?

Intents have a size limit (approx. 1MB). For passing large AI models or long strings in Revochamp, do not use 'putExtra'. Instead, save the data to a file or a database and pass the 'URI' or 'ID' through the Intent.

What is a PendingIntent?

A PendingIntent is a token that you give to another application (like the Notification Manager), which allows that application to execute an Intent on your behalf later, even if your app's process is killed.

Why is my Implicit Intent crashing on some devices?

If no app on the device can handle your implicit intent, the app will crash. In 2026, you must always check if there is an available app using 'resolveActivity' or wrap the 'startActivity' call in a try-catch block.

Previous

android fragments

Next

android lifecycle

Related Content

Need help?

Explore our comprehensive docs or start a chat with our tech experts.