FileDocCategorySizeDatePackage
ActivityRecognitionEvent.javaAPI DocAndroid 5.1 API2082Thu Mar 12 22:22:30 GMT 2015com.android.location.provider

ActivityRecognitionEvent

public class ActivityRecognitionEvent extends Object
A class that represents an Activity Recognition Event.

Fields Summary
private final String
mActivity
private final int
mEventType
private final long
mTimestampNs
Constructors Summary
public ActivityRecognitionEvent(String activity, int eventType, long timestampNs)

        mActivity = activity;
        mEventType = eventType;
        mTimestampNs = timestampNs;
    
Methods Summary
public java.lang.StringgetActivity()

        return mActivity;
    
public intgetEventType()

        return mEventType;
    
public longgetTimestampNs()

        return mTimestampNs;
    
public java.lang.StringtoString()

        String eventString;
        switch (mEventType) {
            case ActivityRecognitionProvider.EVENT_TYPE_ENTER:
                eventString = "Enter";
                break;
            case ActivityRecognitionProvider.EVENT_TYPE_EXIT:
                eventString = "Exit";
                break;
            case ActivityRecognitionProvider.EVENT_TYPE_FLUSH_COMPLETE:
                eventString = "FlushComplete";
                break;
            default:
                eventString = "<Invalid>";
                break;
        }

        return String.format(
                "Activity='%s', EventType=%s(%s), TimestampNs=%s",
                mActivity,
                eventString,
                mEventType,
                mTimestampNs);