<tfoot id='HaZFc'></tfoot>

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

    <legend id='HaZFc'><style id='HaZFc'><dir id='HaZFc'><q id='HaZFc'></q></dir></style></legend>

        • <bdo id='HaZFc'></bdo><ul id='HaZFc'></ul>
      1. java io ioexception 无法解析来自服务器地理编码器的响应

        时间:2023-05-27
          <tbody id='RNNWl'></tbody>
      2. <tfoot id='RNNWl'></tfoot>
        <legend id='RNNWl'><style id='RNNWl'><dir id='RNNWl'><q id='RNNWl'></q></dir></style></legend>
        • <bdo id='RNNWl'></bdo><ul id='RNNWl'></ul>

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

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

                1. 本文介绍了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 无法解析来自服务器地理编码器的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文章

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

                  1. <small id='YNcwe'></small><noframes id='YNcwe'>

                  2. <legend id='YNcwe'><style id='YNcwe'><dir id='YNcwe'><q id='YNcwe'></q></dir></style></legend>