私が追加しました:
implements GoogleApiClient.ConnectionCallbacks, LocationListener, GpsStatus.Listener
と:
mGoogleApiClient = new GoogleApiClient.Builder(context)
.addApi(LocationServices.API)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.build();
mGoogleApiClient.connect();
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
locationManager.addGpsStatusListener(this);
と:
@Override
public void onGpsStatusChanged(int event) {
Log.d(TAG, "GPS status change: " + event);
switch(event) {
case GpsStatus.GPS_EVENT_FIRST_FIX:
break;
case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
break;
}
}
ただし、Fused Location API では onGpsStatusChanged は呼び出されません。これは可能ですか?