Network location provider not giving location android

前端 未结 3 2026
名媛妹妹
名媛妹妹 2020-12-10 09:47

I am developing a small android application in which I want to find out the user\'s current location by using the network provider. I tried this in following ways but it\'s

3条回答
  •  佛祖请我去吃肉
    2020-12-10 10:21

    Is your network provider enabled?

    boolean network_enabled;
    try {
        network_enabled = locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
    } catch(Exception ex) {
       ex.printStackTrace();
    }
    

提交回复
热议问题