标签:
LocationClient现在无法使用,以下是新的解决方案
https://developer.android.com/training/location/retrieve-current.html
public class MainActivity extends ActionBarActivity implements ConnectionCallbacks, OnConnectionFailedListener { ... @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())); } } }
标签:
原文地址:http://www.cnblogs.com/visionary/p/4340890.html