4

How can I enable/disable NETWORK_PROVIDER on my AVD?

public class MyActivity extends Activity{
   @Override
   protected void onResume(){
      super.onResume();

      LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_PROVIDER);
      if (lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) Log.e("D", "ONLINE !");
      else Log.e("D", "OFFLINE !");
   }
}

Each time when Activity is created I am getting via Logcat: OFFLINE ! How to turn on NETWORK_PROVIDER on AVD? As you can see, "Google's location service" is active.

enter image description here

Zbarcea Christian
  • 9,367
  • 22
  • 84
  • 137
  • 2
    Possible duplicate - http://stackoverflow.com/questions/2424564/activating-network-location-provider-in-the-android-emulator – Dimmerg Jun 27 '13 at 09:30

0 Answers0