import com.google.android.gms.common.*; import com.google.android.gms.common.api.*; import com.google.android.gms.fitness.*; ... // Prerequisite: Create a Google API client object and connect to the service // (For details, see Getting Started) public class MainActivity extends AppCompatActivity { ... public void invokeFitnessAPIs() { // Call the Fitness APIs here ... // 1. Invoke the History API with the Google API client object PendingResult pendingResult = HistoryApi.disableFit(mClient); // 2. Check the result (see other examples) } }