-1

例を作成しようとしています: http://developer.android.com/training/basics/location/geocoding.html#TaskReverseGeocoding

動作しますが、実際に私は得ました

サービス利用不可の例外

アドレスを取得しようとしたとき、私はこれをやり遂げ、API キーとこれらすべてのものを取得しましたが、何も変更されておらず、デバイス自体でも機能しません!

4

1 に答える 1

2
    Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); 
    try {
        List<Address> addresses = geoCoder.getFromLocation(latitude, longitude, 1);
        if (addresses.size() > 0) {
            String address = "";
            for (int index = 0; index < addresses.get(0).getMaxAddressLineIndex(); index++)
                address += addresses.get(0).getAddressLine(index) + " ";
            tv.setText(address);                   Toast.makeText(getApplicationContext(),""+address,Toast.LENGTH_SHORT).show();
            Log.v("AddressTag", address);
        }
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

于 2012-12-13T13:31:29.030 に答える