Geocoder.isPresent()未定义类型Geocoder

我的Android和Java技能不是很热……

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

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

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

if (Geocoder.isPresent()) {... 

Eclipse告诉我

对于Geocoder类型,方法isPresent()未定义

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

public static boolean isPresent()方法仅适用于API级别9,这意味着您应该使用Android 2.3或更高版本。 确保你使用它。 然后检查Android SDK的Eclipse项目配置。

参考: http : //developer.android.com/reference/android/location/Geocoder.html