[英]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。请帮我解决这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.