Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为什么我的应用程序没有';在语言发生变化后,你得不到地址?_Android_Google Maps - Fatal编程技术网

Android 为什么我的应用程序没有';在语言发生变化后,你得不到地址?

Android 为什么我的应用程序没有';在语言发生变化后,你得不到地址?,android,google-maps,Android,Google Maps,我从以下位置获得地址: GeoPoint p; Geocoder geocoder = new Geocoder(this, Locale.getDefault()); Location location = new Location("A"); location.setLatitude(34.7461307); location.setLongitude(135.5738767); p = new GeoPoint

我从以下位置获得地址:

GeoPoint p;
        Geocoder geocoder = new Geocoder(this, Locale.getDefault());
        Location location = new Location("A");
        location.setLatitude(34.7461307);
        location.setLongitude(135.5738767);
        p = new GeoPoint((int) (location.getLatitude() * 1E6),
                (int) (location.getLongitude() * 1E6));
        List<Address> add = null;
        try {
            add = geocoder.getFromLocation(p.getLatitudeE6() / 1E6,
                    p.getLongitudeE6() / 1E6, 1);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            // e.printStackTrace();
        }
        String addressjian = null;
        if (add != null && add.size() > 0) {
            // Get address
            String post = "";

            for (int i = 0; i <= add.get(0).getMaxAddressLineIndex(); i++) {
                String country = add.get(0).getCountryName();
                post = add.get(0).getPostalCode();
                if (!add.get(0).getAddressLine(i).equals(country)) {
                    if (addressjian != null && !addressjian.equals("")) {
                        addressjian = addressjian + ", ";
                    }
                    addressjian += add.get(0).getAddressLine(i);
                }

            }

        }
但如果我将语言设置为日语,结果是:

[Address[addressLines=[0:"1丁目-21 Yagumo Higashimachi",1:"Moriguchi, Osaka Prefecture 570-8588",2:"Japan"],feature=570-8588,admin=null,sub-admin=null,locality=null,thoroughfare=null,postalCode=570-8588,countryCode=JP,countryName=Japan,hasLatitude=true,latitude=34.7456387,hasLongitude=true,longitude=135.5744525,phone=null,url=null,extras=null]]
[Address[addressLines=[0:"〒570-8588",1:"日本"],feature=570-8588,admin=null,sub-admin=null,locality=null,thoroughfare=null,postalCode=570-8588,countryCode=JP,countryName=日本,hasLatitude=true,latitude=34.7456387,hasLongitude=true,longitude=135.5744525,phone=null,url=null,extras=null]]

为什么它没有得到街道的名字?为什么取决于设备的语言?

可能是设备不支持该语言。它可以设置语言、输入、显示ok。