0
我有一个文本视图来显示我的经度和纬度,现在的问题是我总是得到这对夫妇(32,35)(这是我认为的某个海洋中的某个地方),我甚至去过出去散步,给全球定位系统一个机会,但我什么都没有。Android获取静态错误的位置
我想看看它是否与我的手机或手机中的GPS有关,所以我继续打开Waze应用程序,看到它实际上工作。
可能是什么问题?
这里是我的简单的代码片段:
public class Main extends Activity implements LocationListener {
private LocationManager manager;
private TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv = (TextView) findViewById(R.id.textView1);
tv.setText("Hello There");
manager = (LocationManager) this.getSystemService(LOCATION_SERVICE);
manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
}
@Override
public void onLocationChanged(Location location) {
tv.setText((int)location.getLatitude()+ ","+ (int)location.getLongitude());
}
...
}
权限被添加? – 2012-08-16 10:20:05
@MMohsinNaeem:他说他在谷歌地图中获得了valus(32,35) – MAC 2012-08-16 10:21:28