我想获取当前位置(纬度和经度),当WiFi& Gps关闭.可以从移动SIM网络获取经度和纬度.我在Google上搜索了更多内容,但没有得到满意的答案.
解决方法:
尝试这个
LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location location = lm.getLastKNownLocation(LocationManager.GPS_PROVIDER);
if(location==null){
location = lm.getLastKNownLocation(LocationManager.NETWORK_PROVIDER);
}