isPresent()
检查GeoCoder
服务是否正常
在应用程序中运行if(GeoCoderObject.isPresent()){
Log.d("Message","GeoCoder instance is there");
try{
someMethod();
}
catch(IOException){
Log.d("Message","Wiered Scenario");
}
catch(Esception e){
Log.d("Message","Geocoder service not available");
}
}else{
Log.d("Message","GeoCoder instance is not there");
}
java.io.IOException: Service not Available
This is a similar behaviour as seen in another answer of stackoverflow here
注意: 这个isPresent()昨天与设备完美配合。今天它提出了这个错误(没有进行代码更改)