java.io.IOException: grpc failed

前端 未结 24 1047
野性不改
野性不改 2020-12-02 20:00

When I use call getFromLocationName I get an IOException with description \"grpc failed\".

Code that\'s ran

@Override
public void onMapReady(GoogleMa         


        
24条回答
  •  情歌与酒
    2020-12-02 20:33

    From my experience, I can say this error is thrown by the Geocoder's getFromLocation() method. So don't do the following:

    • Do not call this method on main thread. This will freeze the UI and if anything which depends on the result of this method will crash. Handle this case.
    • When there's no internet connection, again, the IOExeption will be thrown. Again, anything depending on the result of this method will crash. Handle this case.

提交回复
热议问题