Skip to content

Instantly share code, notes, and snippets.

@kayahanbaskeser
Created June 30, 2020 13:14
Show Gist options
  • Save kayahanbaskeser/1ea3a466b0ea70e8957ebd063f294a96 to your computer and use it in GitHub Desktop.
Save kayahanbaskeser/1ea3a466b0ea70e8957ebd063f294a96 to your computer and use it in GitHub Desktop.
HiHealthOptions options = HiHealthOptions.builder().build();
AuthHuaweiId signInHuaweiId = HuaweiIdAuthManager.getExtendedAuthResult(options);
AutoRecorderController controller = HuaweiHiHealth.getAutoRecorderController(context, signInHuaweiId);
controller.stopRecord(DataType.DT_CONTINUOUS_STEPS_TOTAL)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> taskResult) {
if (taskResult.isSuccessful()) {
Log.i("AutoRecorderTest","onComplete stopRecordByType Successful");
} else {
Log.i("AutoRecorderTest","onComplete stopRecordByType Failed");
}
}
})
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void result) {
Log.i("AutoRecorderTest","onSuccess stopRecordByType Successful");
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Log.i("AutoRecorderTest","onFailure stopRecordByType Failed: " + e.getMessage());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment