I am working on a health app using google fit In which i have a setting option to turn On/Off Activity detection . I researched a lot but didn't get any solution for it . Can anyone tell me how to achieve this funtionality?
To stop activity recognition you have to do this :
ActivityRecognition.ActivityRecognitionApi.removeActivityUpdates(
mGoogleApiClient,
getActivityDetectionPendingIntent()
).setResultCallback(this);
Here is the documentation if you wanna have a look