Java Geocoder.isPresent()类型Geocoder未定义

Java Geocoder.isPresent()类型Geocoder未定义,java,android,google-geocoder,Java,Android,Google Geocoder,我的Android和Java技能并不那么热门 在Geocoder的developer.android.com页面上,它说: 如果平台中没有后端服务,Geocoder查询方法将返回空列表。使用isPresent()方法确定是否存在地理编码器实现 但是,当我尝试打电话时,例如: if (Geocoder.isPresent()) {... 日食告诉我 未为Geocoder类型定义isPresent()方法 我如何才能“使用isPresent()方法”?公共静态布尔isPresent()方法只能从A

我的Android和Java技能并不那么热门

在Geocoder的developer.android.com页面上,它说:

如果平台中没有后端服务,Geocoder查询方法将返回空列表。使用isPresent()方法确定是否存在地理编码器实现

但是,当我尝试打电话时,例如:

if (Geocoder.isPresent()) {...
日食告诉我

未为Geocoder类型定义isPresent()方法


我如何才能“使用isPresent()方法”?

公共静态布尔isPresent()方法只能从API级别9获得,这意味着您应该使用Android 2.3或更高版本。确保你正在使用它。然后检查Android SDK的Eclipse项目配置


参考资料:

您是否导入了谷歌地图api库?这将对你有帮助