2
當用戶禁用Google健身時,我希望我的應用可以檢查Google健身是啓用還是禁用狀態。我只找到禁用該應用程序的代碼。如何從Google健身檢查啓用或禁用狀態
public void disableGoogleFit(){
if(!mClient.isConnected()){
Log.e(TAG, "Google Fit wasn't connected");
return;
}
PendingResult<Status> pendingResult = Fitness.ConfigApi.disableFit(mClient);
pendingResult.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
if(status.isSuccess()) {
Log.i(TAG, "Google Fit disabled");
}else{
Log.e(TAG, "Google Fit wasn't disabled " + status);
}
}
});
}
如何檢測Intent何時被調用?