简体   繁体   中英

Android Location API using Google Play Services

I use to implement location fonder using with Android developer tutorial " https://developer.android.com/training/location/index.html ".my application is running but didn't find the location.

it is break @Override

`public void onConnected(Bundle connectionHint) {`
    mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
    if (mLastLocation != null) {
        mLatitudeText.setText(String.valueOf(mLastLocation.getLatitude()));
        mLongitudeText.setText(String.valueOf(mLastLocation.getLongitude()));
    } else {
        Toast.makeText(this, R.string.no_location_detected, Toast.LENGTH_LONG).show();
    }

}`

with here and show no_location_detect .please guild me to solve this problem

通过这个链接。我已经按照相同的http://www.kpbird.com/2013/06/fused-location-provider-example.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM