Code example for ActivityRecognitionClient

Methods: requestActivityUpdates

0
                    ActivityRecognitionIntentService.class); 
            intent.setAction(LocationActivity.ACTION_ACTIVITY_RECOGNITION);
            mActivityRecognitionPendingIntent = PendingIntent.getService(LocationActivity.this, 0,
                    intent,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            mActivityRecognitionClient.requestActivityUpdates(ACTIVITY_UPDATES_INTERVAL,
                    mActivityRecognitionPendingIntent);
        } 
 
        @Override 
        public void onDisconnected() { 
            Log.v(LocationActivity.TAG, "Activity Recognition Client disconnected by the system");
        } 
 
        @Override 
        public void onConnectionFailed(ConnectionResult result) {
            Log.v(LocationActivity.TAG,
                    "Activity Recognition Client connection failed " + result.getErrorCode());
        } 
    };