开发者

Geocoder Exception in Android

I'm using geocoder class to find out lat/开发者_JS百科lon from a given address string. While doing this it gives me

java.io.IOException: Unable to parse response from server this exception.

I dont understand why.

Here is my code:

geocoder=new Geocoder(FindFishActivity.this);
    try {
        List<Address>foundLake=geocoder.getFromLocationName(strSearch,2);

        if(foundLake.size()==0)
        {
            Toast.makeText(this,"Sorry,could not find data",Toast.LENGTH_LONG);
        }
        else
        {
            for(int i=0;i<foundLake.size();i++)
            {
                Address address=foundLake.get(i);
                lat=address.getLatitude();

                lon=address.getLongitude();

                Log.i("Lakes",""+lat+""+lon);
                navigateToLocation((lat * 1000000), (lon * 1000000), mapview); 

            }
        }
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜