我的 Android 和 Java 技能不是很好......
在 Geocoder 的 developer.android.com 页面中,它说:
The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists.
但是,当我尝试调用时,例如:
if (Geocoder.isPresent()) {...
Eclipse 告诉我
The method isPresent() is undefined for the type Geocoder
如何“使用 isPresent() 方法”?
最佳答案
public static boolean isPresent () 方法仅适用于 API 级别 9,这意味着您应该使用 Android 2.3 或更高版本。确保你正在使用它。然后检查 Android SDK 的 Eclipse 项目配置。
引用:http://developer.android.com/reference/android/location/Geocoder.html
关于java - Geocoder.isPresent() 未定义 Geocoder 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5707685/