2.1中的LocationManager无法正常工作? [英] LocationManager in 2.1 not working?

查看:142
本文介绍了2.1中的LocationManager无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使以下代码在最近4个小时内正常工作.

I have been trying to get the following code to work for the last 4 hours.

public void clearLocation() { 
    LocationManager locMan =
            (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
    locMan.clearTestProviderLocation("gps"); 

我的问题是,它仅适用于Android 1.5.在1.6及更高版本上,它在到达第二条语句时便崩溃了.

My problem is that it will only work with Android 1.5. On 1.6 and newer it just crashes when it reaches the second statement.

我一直在浏览各种代码段和教程,但是却找不到任何东西.

I've been looking through various code snippets and tutorials, but haven't been able to find anything about this.

问候,亚当.

推荐答案

嗯...发现您无法在1.6+版本中更改有关位置提供程序"gps"的任何内容

Well... found out that you can't change anything about the location provider "gps" in 1.6+

这篇关于2.1中的LocationManager无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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