Я позволил GPS в устройстве, но я не получаю локацию:Android Gps места
LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
if(lm.isProviderEnabled(LocationManager.GPS_PROVIDER))
{
Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if(location!=null)
{
showCurrentAddress(location);
}
}
Но здесь я собирающее место является нулевым, и я добавил следующие разрешения на мой код:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Не могли бы вы помочь?
Попробуйте это [ссылка] [ 1] [1]: http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current- location-in-a/3145655 # 3145655 Для обсуждения Get GPs Location – Dinesh
Попробуйте это [ссылка] [1] [1]: http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location- в-а/3145655 # 3145655 – Dinesh