Skip to content Skip to sidebar Skip to footer

Why Don't I Get Proximity Alterts Even Though I've Registered Alerts?

I'm trying to simply set a proximity later for an area an for testing, I simply added this to the onCreate method of my main activity. public void onCreate(Bundle bndBundle) {

Solution 1:

You are registering this receiver dynamically, through registerReceiver(), to have it respond to broadcasts whose action string is WidgetService.ACTION_STOP_PROXIMITY.

However, the actual broadcast you are sending is trying to use an explicit Intent, identifying your receiver class. This does not line up with the IntentFilter that you are using with registerReceiver().

Either:

  • Register your receiver in the manifest and get rid of registerReceiver(), in which case your explicit Intent will work, or

  • Use new Intent(WidgetService.ACTION_STOP_PROXIMITY) instead of new Intent(this, ProximityIntentReceiver.class), so your Intent lines up with your IntentFilter

You cannot use explicit Intent objects to send broadcasts to receivers registered via registerReceiver(). An explicit Intent will only work with a manifest-registered receiver.


Solution 2:

make sure you type in the right coordinates. in DDMS they're reversed, longitude first, then latitude


Post a Comment for "Why Don't I Get Proximity Alterts Even Though I've Registered Alerts?"