Code example for ActivityRecognitionClient

0
 
     
    private ActivityRecognitionClient getActivityRecognitionClient() {
        if (mActivityRecognitionClient == null) {
            mActivityRecognitionClient =
                    new ActivityRecognitionClient(mContext, this, this);
        } 
        return mActivityRecognitionClient;
    } 
 
     
    private void requestDisconnection() { 
        getActivityRecognitionClient().disconnect();
    } 
 
     
    @Override 
    public void onConnected(Bundle arg0) {
        Log.d(ActivityUtils.APPTAG, "Detection client connected");
        continueRequestActivityUpdates(); 
    }