[英]How to get that check box is enable or disable status using Selenium webdriver?
[英]How to check enable or disable status from Google Fit
當用戶停用Google健身時,我希望我的應用檢查Google Fit是啟用還是禁用狀態。 我只找到了禁用該應用的代碼。
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的時間?
您可以查看Google的入門文檔,以下是文檔中的代碼示例:
if (mClient == null && checkPermissions()) {
mClient = new GoogleApiClient.Builder(this)
.addApi(Fitness.SENSORS_API)
.addScope(new Scope(Scopes.FITNESS_LOCATION_READ))
.addConnectionCallbacks(
new GoogleApiClient.ConnectionCallbacks() {
@Override
public void onConnected(Bundle bundle) {
Log.i(TAG, "Connected!!!");
// Now you can make calls to the Fitness APIs.
findFitnessDataSources();
}
這將檢查與Google健身的連接。
希望這可以幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.