How to enable Network Location provider automatically
android
Solution
It is impossible to enable the network provider location automatically as already mentioned. The correct way is to display a box and redirect the user to the settings page. You can enable GPS by using a slight hack as mentioned here. Still I wouldn't suggest doing that.
Problem
I am fetching Latitude and Longitude through network It is giving me latitude and longitude but what if my `NETWORK LOCATION PROVIDER` is unchecked It will never provide me the Latitude and Longitude of the current location. What i want is, How Can I enable the `NETWORK LOCATION PROVIDER` in phone without knowing user that It is opened, How can i do that? What i have tried is: ``` Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivityForResult(intent, 1); But this will open the page in my phone to check it i want to check AUTOMATICALLY Intent intent = new Intent(Intent.ACTION_MAIN); intent.setClassName("com.android.phone", "com.android.phone.Settings"); startActivity(intent); ```