Hello everybody !

I'm new to android and I try to use LocationManage.addProximityAlert()
method to wake up my application at a specific geopoint.

I create Intent, Intent filter and PendingIntent. I had the
ProximityAlert to my LocationManager. I do all these things in my
MapActivity Class.

public class BasicMap extends MapActivity {
...
  private void setProximityAlert(double lat, double lng, String title,
String text) {
    ...
    Intent intent = new Intent
("android.intent.action.PROXIMITY_ALERT");
    PendingIntent proximityIntent = PendingIntent.getBroadcast
(getApplicationContext(), -1, intent, 0);
    locationManager.addProximityAlert(lat, lng, radius, expiration,
proximityIntent);

    IntentFilter filter = new IntentFilter
("android.intent.action.PROXIMITY_ALERT");
    registerReceiver(new ProximityIntentReceiver(title, text),
filter);
    ...
    }
}

In another class ProximityIntentReceiver, I log the location in the
onRecieve() method :

public void onReceive (Context context, Intent intent) {
                Log.e("onReceive", "location intent fired: "+pi_title+", 
"+pi_text);
                ...
}


And it does not work !! I change the emulator location and the log is
never displayed.

What's wrong with my code ?

Does anybody now a good toturial explaining how to use
addProximityAlert() properly ?

Thanx.
 thom.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to