当前位置:编程学习 > JAVA >>

android GPS JAVA获取GPS功能是否禁用

获取GPS功能是否禁用:
Java代码 
mgr=(LocationManager)getSystemService(LOCATION_SERVICE); 
        if(mgr.isProviderEnabled((android.location.LocationManager.GPS_PROVIDER ))) 
                Toast.makeText(TestActivity.this,"gps enable", Toast.LENGTH_SHORT).show(); 
        else Toast.makeText(TestActivity.this,"gps dis", Toast.LENGTH_SHORT).show(); 

作者“极客网络”
 

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,