2

こんにちは、ニューヨークの住所を取得するコードと次のコードを作成しました。

public void onLocationChanged(Location location) {
    // TODO Auto-generated method stub

        txtLocationView.setText("Longitudes: "
                + String.valueOf(location.getLongitude()) + "Latitudes:"
                + String.valueOf(location.getLatitude()));
        Geocoder geoCoder = new Geocoder(this, Locale.ENGLISH);

        try {
            List<Address> addresses = geoCoder.getFromLocation(
                    location.getLatitude(), location.getLongitude(), 10);

            String address = addresses.get(0).getAddressLine(0);
            String city = addresses.get(0).getAddressLine(1);
            String country = addresses.get(0).getAddressLine(2);
            txtAddressView.setText("Address:"  + addresses);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


    }

しかし、tis はヌルの Address list を返しました。うーん、場所を正しく通過します。何がうまくいかない可能性がありますか?

4

0 に答える 0