Action | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Constants | Methods | Inherited Methods | [Expand All]
public final class

# Action

extends Thing

java.lang.Object
↳ | com.google.android.gms.appindexing.Thing
| ↳ | com.google.android.gms.appindexing.Action

## Class Overview

Represents an action performed by a user.

To use this API, add the following to your `Activity`:

     Action action = Action.newAction(actionType, title, appUri);
     AppIndex.AppIndexApi.action(mGoogleApiClient, action);

## Summary

Nested Classes
class | Action.Builder | Create a builder for an `Action`.

Constants
String | STATUS_TYPE_ACTIVE | The status of an active action (i.e.
String | STATUS_TYPE_COMPLETED | The status of a completed action.
String | STATUS_TYPE_FAILED | The status of a failed action.
String | TYPE_ADD | The act of editing by adding an object to a collection.
String | TYPE_BOOKMARK | The act of bookmarking an object.
String | TYPE_LIKE | The act of liking an object.
String | TYPE_LISTEN | The act of consuming audio content.
String | TYPE_VIEW | The act of consuming static visual content.
String | TYPE_WANT | The act of expressing a desire about the object.
String | TYPE_WATCH | The act of watching an object.

Public Methods
static Action | newAction(String actionType, String objectName, Uri objectId, Uri objectAppUri) Creates a new action.
static Action | newAction(String actionType, String objectName, Uri objectAppUri) Creates a new action.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Constants

#### public static final String STATUS_TYPE_ACTIVE

The status of an active action (i.e. an action that has started but not yet completed).

Constant Value: "http://schema.org/ActiveActionStatus"

#### public static final String STATUS_TYPE_COMPLETED

The status of a completed action.

Constant Value: "http://schema.org/CompletedActionStatus"

#### public static final String STATUS_TYPE_FAILED

The status of a failed action.

Constant Value: "http://schema.org/FailedActionStatus"

#### public static final String TYPE_ADD

The act of editing by adding an object to a collection.

Constant Value: "http://schema.org/AddAction"

#### public static final String TYPE_BOOKMARK

The act of bookmarking an object.

Constant Value: "http://schema.org/BookmarkAction"

#### public static final String TYPE_LIKE

The act of liking an object.

Constant Value: "http://schema.org/LikeAction"

#### public static final String TYPE_LISTEN

The act of consuming audio content.

Constant Value: "http://schema.org/ListenAction"

#### public static final String TYPE_VIEW

The act of consuming static visual content.

Constant Value: "http://schema.org/ViewAction"

#### public static final String TYPE_WANT

The act of expressing a desire about the object.

Constant Value: "http://schema.org/WantAction"

#### public static final String TYPE_WATCH

The act of watching an object.

Constant Value: "http://schema.org/WatchAction"

## Public Methods

#### public static Action newAction (String actionType, String objectName, Uri objectId, Uri objectAppUri)

Creates a new action.

##### Parameters

actionType | The schema.org action type (e.g. "http://schema.org/ListenAction").
objectName | Name of the content.
objectId | The equivalent web url for the content, if available. Can be null.
objectAppUri | The app URI of the content in the App Indexing format.

#### public static Action newAction (String actionType, String objectName, Uri objectAppUri)

Creates a new action.

##### Parameters

actionType | The schema.org action type (e.g. "http://schema.org/ListenAction").
objectName | The name of the content.
objectAppUri | The app URI of the content in the App Indexing format.