PotentialAction
@ExperimentalAppSearchApi
@Document(name = "builtin:PotentialAction")
public class PotentialAction
An AppSearch document representing an action. This action schema type is used for the nested potentialActions field in entity schema types such as builtin:Thing or builtin:Timer.
- name - This is a unique identifier for the action, such as "actions.intent.CREATE_CALL". See developer.android.com/reference/app-actions/built-in-intents/communications/create-call for an sample Action type.
- description - A brief description of what the action does, such as "Create call" or "Create Message".
- uri - A deeplink URI linking to an action. Invoking the action can be done by creating an
android.content.Intent
object by callingparseUri
with the deeplink URI. Creating a deeplink URI, and adding intent extras, can be done by building an intent and callingtoUri
.
Summary
Nested types |
---|
public final class PotentialAction.Builder Builder for |
Public methods |
|
---|---|
@Nullable String |
Returns a string describing the action. |
@Nullable String |
getName() Returns the BII action ID, which comes from Action IDs of Built-in intents listed at developer.android.com/reference/app-actions/built-in-intents/bii-index. |
@Nullable String |
getUri() Returns the deeplink URI. |
Public methods
getDescription
public @Nullable String getDescription()
Returns a string describing the action.
getName
public @Nullable String getName()
Returns the BII action ID, which comes from Action IDs of Built-in intents listed at developer.android.com/reference/app-actions/built-in-intents/bii-index. For example, the "Start Exercise" BII has an action id of "actions.intent.START_EXERCISE".
getUri
public @Nullable String getUri()
Returns the deeplink URI.
A deeplink URI is a URI that lets a user access a specific content or feature within an app directly. Users can create one by adding parameters to the app's base URI. To use a deeplink URI in an Android application, users can create an android.content.Intent
object by calling parseUri
with the deeplink URI. Creating a deeplink URI, and adding intent extras, can be done by building an intent and calling toUri
.