LocationManager是null怎么办

来源:互联网 发布:高清直播电视软件 编辑:程序博客网 时间:2024/06/01 12:30
今天学习安卓手机的GPS定位,然后发现这个位置管理器一直是null
   locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        if(locationManager == null){
            show.setText("locationManager 创建成功!");
        }else{
            show.setText("locationManager 创建失败!");
        }

我测试的时候显示创建失败,请问是什么原因。
0 0
原创粉丝点击