<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 无法解析来自服务器地理编码器的响应

        java io ioexception unable to parse response from server geocoder(java io ioexception 无法解析来自服务器地理编码器的响应)
          <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 无法解析来自服务器地理编码器的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                  Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                  How to convert Integer to int?(如何将整数转换为整数?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                  Inconsistent behavior on java#39;s ==(java的行为不一致==)
                  Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)

                        <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>
                          <tbody id='YNcwe'></tbody>

                        • <small id='YNcwe'></small><noframes id='YNcwe'>

                        • <legend id='YNcwe'><style id='YNcwe'><dir id='YNcwe'><q id='YNcwe'></q></dir></style></legend>