Show/Hide Toolbars

Android Applications

Navigation: Android Specifics

Android Intents

Scroll Prev Top Next More

An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed.

 

Intents can

Start an activity

Start a service

Deliver a broadcast

And can be

Implicit (Intent.setAction(TJIntent.JavaClass.ACTION_VIEW) or

Explicit (Intent.setClassName)

 

How Android Handles Incoming Intents

No app: If there are no apps on the device that can receive the implicit intent, the app crashes when it calls startActivity().Note: First verify that there is an app that can receive the intent.

One app: When there is only one app that can handle the intent, the system immediately starts it.

More than one app: If there is more than one app that can handle the activity, the system displays a dialog for the user to select which app to use.

 

 

Example

https://github.com/Embarcadero/RADStudio10.4Demos/tree/master/Object%20Pascal/Mobile%20Snippets/AndroidIntents