<bdo id='5dbRY'></bdo><ul id='5dbRY'></ul>
  • <tfoot id='5dbRY'></tfoot>

  • <i id='5dbRY'><tr id='5dbRY'><dt id='5dbRY'><q id='5dbRY'><span id='5dbRY'><b id='5dbRY'><form id='5dbRY'><ins id='5dbRY'></ins><ul id='5dbRY'></ul><sub id='5dbRY'></sub></form><legend id='5dbRY'></legend><bdo id='5dbRY'><pre id='5dbRY'><center id='5dbRY'></center></pre></bdo></b><th id='5dbRY'></th></span></q></dt></tr></i><div id='5dbRY'><tfoot id='5dbRY'></tfoot><dl id='5dbRY'><fieldset id='5dbRY'></fieldset></dl></div>

        <small id='5dbRY'></small><noframes id='5dbRY'>

        <legend id='5dbRY'><style id='5dbRY'><dir id='5dbRY'><q id='5dbRY'></q></dir></style></legend>
      1. java io ioexception 无法解析来自服务器地理编码器的

        时间:2023-09-30
            <tbody id='u1QDj'></tbody>
          • <bdo id='u1QDj'></bdo><ul id='u1QDj'></ul>

            1. <legend id='u1QDj'><style id='u1QDj'><dir id='u1QDj'><q id='u1QDj'></q></dir></style></legend>
              <tfoot id='u1QDj'></tfoot>

            2. <i id='u1QDj'><tr id='u1QDj'><dt id='u1QDj'><q id='u1QDj'><span id='u1QDj'><b id='u1QDj'><form id='u1QDj'><ins id='u1QDj'></ins><ul id='u1QDj'></ul><sub id='u1QDj'></sub></form><legend id='u1QDj'></legend><bdo id='u1QDj'><pre id='u1QDj'><center id='u1QDj'></center></pre></bdo></b><th id='u1QDj'></th></span></q></dt></tr></i><div id='u1QDj'><tfoot id='u1QDj'></tfoot><dl id='u1QDj'><fieldset id='u1QDj'></fieldset></dl></div>

              <small id='u1QDj'></small><noframes id='u1QDj'>

                  本文介绍了java io ioexception 无法解析来自服务器地理编码器的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在使用此代码获取地理地址:

                  I am using this code to get geographical addresses:

                  private String getAddress(Location location)
                  {
                      try{
                          List<Address>   addresses = new Geocoder(this,Locale.getDefault()).getFromLocation(location.getLatitude(), location.getLongitude(), 1);
                          if(addresses!=null)
                          {
                              String address="Address not available";
                  
                              for(int i=0;i<addresses.size();i++) 
                              {
                  
                                  Address addre=addresses.get(i);
                  
                                  String street=addre.getAddressLine(0);
                                  if(null==street)
                                      street="";
                  
                                  String city=addre.getLocality();
                                  if(city==null) city="";
                  
                                  String state=addre.getAdminArea();
                                  if(state==null) state="";
                  
                  
                                  String country=addre.getCountryName();
                                  if(country==null) country="";
                  
                                  address=street+", "+city+", "+state+", "+country;
                  
                              }
                              return address;
                          }
                  
                      }
                      catch (Exception e) {
                          return "Address not available";
                      }
                      return "Address not available";
                  }
                  

                  之前我得到一个地址列表返回,但现在我每次都得到这个异常:

                  Earlier I was getting an address list returned, but now I get, every time, this exception:

                  java.io.IOException unable to parse response from server 
                  

                  请帮忙.

                  推荐答案

                  终于解决了我的问题.

                  如果您尝试非常频繁地(一分钟内多次)访问服务器以从 lat,long 获取地址,那么您可能会遇到此异常.此问题的解决方案可以是:

                  If you try to hit server very frequently(several times in a minute) for getting address from lat,long then you can get this exception.The solutions of this problem can be:

                  1-请尽量避免在一分钟内多次点击地址.
                  2-在不同的设备上运行此代码.

                  如果您想在同一设备上运行此代码,请清除您的应用数据(或卸载您的应用)并等待一段时间.

                  If you want to run this code on same device then clear your app data(or uninstall your app) and wait for some time.

                  这篇关于java io ioexception 无法解析来自服务器地理编码器的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何从 IP 地址获知地理位置 下一篇:Servlet:提交响应后无法转发

                  相关文章

                  最新文章

                  <legend id='J0mtk'><style id='J0mtk'><dir id='J0mtk'><q id='J0mtk'></q></dir></style></legend>
                  <tfoot id='J0mtk'></tfoot>
                • <small id='J0mtk'></small><noframes id='J0mtk'>

                    <i id='J0mtk'><tr id='J0mtk'><dt id='J0mtk'><q id='J0mtk'><span id='J0mtk'><b id='J0mtk'><form id='J0mtk'><ins id='J0mtk'></ins><ul id='J0mtk'></ul><sub id='J0mtk'></sub></form><legend id='J0mtk'></legend><bdo id='J0mtk'><pre id='J0mtk'><center id='J0mtk'></center></pre></bdo></b><th id='J0mtk'></th></span></q></dt></tr></i><div id='J0mtk'><tfoot id='J0mtk'></tfoot><dl id='J0mtk'><fieldset id='J0mtk'></fieldset></dl></div>

                        <bdo id='J0mtk'></bdo><ul id='J0mtk'></ul>