地理coder.is present()未定义类型地理codeR [英] Geocoder.isPresent() undefined for the type Geocoder

查看:153
本文介绍了地理coder.is present()未定义类型地理codeR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Andr​​oid和Java技能是没有这么热...

My Android and Java skills aren't so hot...

在为地理codeR的developer.android.com页面,它说:

In the developer.android.com page for Geocoder, it says :

中的地缘codeR查询方法将返回在平台列表为空,如果有没有后端服务。使用is present()方法来确定一个地理codeR实施是否存在。

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.

然而,当我尝试调用,例如:

However, when I try to call, for example :

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

Eclipse的告诉我,

Eclipse tells me

该方法present()是未定义的类型地理codeR

The method isPresent() is undefined for the type Geocoder

我怎样才能用为present()方法?

How can I "use the isPresent() method"?

推荐答案

公共静态布尔是present()方法只能从API 9级,这意味着你应该使用Android 2.3或较新版本了点。请确保您使用。然后检查Android SDK中Eclipse项目的配置。

public static boolean isPresent () method only available from API level 9, It means you should use Android 2.3 or latter version for that. Make sure you are using that. Then check Eclipse project configuration for Android SDK.

参考: http://developer.android.com/参考/安卓/位置/地理位置coder.html

这篇关于地理coder.is present()未定义类型地理codeR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆