Class Info |
|---|
public class ActivityConversionData implements Parcelable Activity conversion event. You can obtain a list of conversion events using getActivityConversionDatas() of the ActivityConversionResponse class. |
Java
ActivityIdentificationResponse activityRecognitionResult =
ActivityIdentificationResponse.getDataFromIntent(intent);
if (activityRecognitionResult != null) {
List<ActivityIdentificationData> list = activityRecognitionResult.getActivityIdentificationDatas();
} Kotlin
val activityRecognitionResult =
ActivityIdentificationResponse.getDataFromIntent(intent)
if (activityRecognitionResult != null) {
val list =
activityRecognitionResult.activityIdentificationDatas
} Qualifier and Type | Field and Description |
|---|---|
static final Creator<ActivityConversionData> | Default builder for deserializing the activity conversion event. |
Constructor Name |
|---|
| Builds an ActivityConversionData instance. |
ActivityConversionData(int activityType, int conversionType, long elapsedTimeFromReboot) Builds an ActivityConversionData instance. |
Qualifier and Type | Method Name and Description |
|---|---|
int | Obtains the conversion activity type. |
int | Obtains the conversion type. |
long | Obtains the number of nanoseconds elapsed since the device boot time to the activity conversion time. |
Fields |
|---|
public static final Creator<ActivityConversionData> CREATOR Default builder for deserializing the activity conversion event. |
Constructor |
|---|
public ActivityConversionData() Builds an ActivityConversionData instance. |
Constructor |
|---|
public ActivityConversionData(int activityType, int conversionType , long elapsedTimeFromReboot) Builds an ActivityConversionData instance by specified parameters. The value of the activityType parameter must be one of the activity types defined by ActivityIdentificationData, and the value of the conversionType parameter must be one of the conversion types defined by ActivityConversionInfo. Otherwise, an error indicating invalid parameter will be thrown. |
Parameters
Name | Description |
|---|---|
activityType | Activity type. For details, please refer to Constant Values. |
conversionType | Conversion type. For details, please refer to Constant Values. |
elapsedTimeFromReboot | Number of nanoseconds elapsed since the device boot time to the activity conversion time. |
Throws
Name | Description |
|---|---|
IllegalArgumentException | Invalid parameter. Ensure that the values of activityType and conversionType are valid. |
Method |
|---|
public int getActivityType() Obtains the conversion activity type. The value is one of the activity types defined in ActivityIdentificationData. Activity type OTHERS is not supported. |
Returns
Type | Description |
|---|---|
int | Activity type. The activity type cannot be OTHERS. For details, please refer to Constant Values. |
Method |
|---|
public int getConversionType() Obtains the conversion type. The value is one of the conversion types defined in ActivityConversionInfo. |
Returns
Type | Description |
|---|---|
int | Conversion type. For details, please refer to Constant Values. |