即使我使用 API 级别 10,Eclipse 也无法识别 Android API 级别 9 调用
我正在尝试使用 Sensor.TYPE_LINEAR_ACCELERATION。根据文档,从 9 级(姜饼)开始,这个 API 应该是可调用的。但是,Eclipse 给我语法错误,并认为传感器无权访问 TYPE_LINEAR_ACCELERATION。我调用 Sensor.TYPE_ACCELEROMETER 没有问题。我在 eclipse 上的运行配置显示我的目标是 android 2.3.3 或 API 级别 10。是否还有其他地方需要检查包是否是从 2.3 而不是旧版本导入的?
谢谢
I'm trying to use Sensor.TYPE_LINEAR_ACCELERATION. Accrording to documentation, starting since level 9 (gingerbread) this API should be callable. However, eclipse is giving me syntax error, and thinks Sensor does not have access to TYPE_LINEAR_ACCELERATION. I have no problem calling Sensor.TYPE_ACCELEROMETER tho. My running configuration on eclipse shows that my target is android 2.3.3 or API level 10. Is there any other place that I need to check to whether the packages are imported from 2.3 and not older versions?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修好了。尽管我用 2.3 运行模拟器,但我是用 2.1 构建的。所以我对其进行了更改,现在它可以使用 2.3 进行构建。
Fixed it. Even though I was running the emulator with 2.3, I was building with 2.1. So I changed it so it now builds with 2.3.