How to check if LocationManager.NETWORK_PROVIDER is available?
I enabled in AndroidManifest.xml but I need to check that in code and if is not available to use GPS_PROVIDER. Can someone help me ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use this Part to check whether Network Provider is Enabled or Not :
This will return a boolean values :
true– if enabled.
false – not enabled.
additionally for checking if GPS Provider Enabled :
This will return a boolean values :
true– if enabled.
false – not enabled.
If you want the user to Enable Network or GPS Provider use this code to redirect user to Settings Page :