0

i created a broadcast receiver for get information gps turn on or off in android. code used:

public class GpsReceiver extends BroadcastReceiver{

    @Override
    public void onReceive(Context context, Intent intent) {
          if (intent.getAction().matches("android.location.PROVIDERS_CHANGED")) {
               Log.i("DIGICERTO","ALTEROU GPS");
            }
    }

}

I got no response log , why ?

Dhaval Parmar
  • 18,812
  • 8
  • 82
  • 177

1 Answers1

0

you have to register this receiver on manifest with intent-filter android.location.PROVIDERS_CHANGED

Deepak
  • 756
  • 4
  • 10