Java getpostalcode()未返回邮政编码

Java getpostalcode()未返回邮政编码,java,android,android-layout,geolocation,Java,Android,Android Layout,Geolocation,我写了这样的代码。。其返回城市名称正确,但未返回相应地区的邮政编码 try { addresses = gcd.getFromLocation(loc.getLatitude(), loc.getLongitude(), 1); if (addresses.size() > 0) { cityName=addresses.get(0).getLocality

我写了这样的代码。。其返回城市名称正确,但未返回相应地区的邮政编码

 try 
         {
             addresses = gcd.getFromLocation(loc.getLatitude(), loc.getLongitude(), 1);
             if (addresses.size() > 0)
             {
                 cityName=addresses.get(0).getLocality();
                 //areaname = addresses.get(0).getLocale();
                 System.out.println(cityName);
                 postalcode = addresses.get(0).getPostalCode();
             }

         }
         catch (IOException e) 
         {
             e.printStackTrace();
         }

         String s = longitude+"\n"+latitude +"\n\nMy Currrent City is: "+cityName +" \n and postal code of area is " +postalcode;
         editLocation.setText(s);

类似于…请查看它是否解决了问题…它返回null?也许邮政编码是未知的?你试过几个不同的地址吗?我试过班加罗尔。。我认为这是一个很好的测试用例示例。。它返回纬度、经度和城市名称。。对我来说,唯一的问题是邮政。