java.io.IOException: Unable to parse response from server at getFromLocationName()

后端 未结 7 685
醉酒成梦
醉酒成梦 2021-01-12 20:41

I know the question has been asked frequently before ,but i am unable to get the solution from any answer or search results. I have to solve this issue ASAP .. I am trying t

7条回答
  •  伪装坚强ぢ
    2021-01-12 21:17

    I dont know if it helps BTW below is snippet from my project working fine modify it to suit your needs

    String newAddress = saveas.getText().toString();
    searchFromLocationName(newAddress);
    
    
    private void searchFromLocationName(String name){
     try {
      List
    result = myGeocoder.getFromLocationName(name, MAX_RESULT); if ((result == null)||(result.isEmpty())){ Toast.makeText(AndroidgetFromLocationNameActivity.this, "No matches were found or there is no backend service!", Toast.LENGTH_LONG).show(); }else{ MyArrayAdapter adapter = new MyArrayAdapter(this, android.R.layout.simple_list_item_1, result); listviewResult.setAdapter(adapter); Toast.makeText(AndroidgetFromLocationNameActivity.this, "Finished!", Toast.LENGTH_LONG).show(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); Toast.makeText(AndroidgetFromLocationNameActivity.this, "The network is unavailable or any other I/O problem occurs!", Toast.LENGTH_LONG).show(); } }

提交回复
热议问题