GPSまたはネットワークから場所を取得しています。問題は、私は htc の欲望 hd でそれをテストし、それは完全に正常に動作したことです, しかし今、私はサムスンのギャラクシーの場所にある他のデバイスでテストを開始し、常にnullです.
これが場所を取得するための私のコードです
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
currentLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if( currentLocation == null){
currentLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
}
前もって感謝します