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

后端 未结 7 756
醉酒成梦
醉酒成梦 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:41

    I solved the same issue changing the context.

    I use Fragment, so my code is like this

        public class SearchRoteFragment extends Fragment{
    
            @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.teste_mapa, container, false);
            context = getActivity();
    ...
    }
    

    and when I call geocode I do this

    Geocoder geoCoder = new Geocoder(context, Locale.getDefault());
    

提交回复
热议问题