繁体   English   中英

使用Google Play服务的Android Location API

[英]Android Location API using Google Play Services

我使用Android开发人员教程“ https://developer.android.com/training/location/index.html ”。我的应用程序正在运行,但没有找到位置。

它是破解@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();
    }

}`

在这里并显示no_location_detect。请帮我解决这个问题

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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