Hi,
I have more than one problem to use the addProximityAlert() method
from the LocationManager class.
The first thing is that I want to create a PendingIntent for a
broadcast receiver. Therefor I use this code:
Intent intent = new Intent("app1.PROXIMITY_ALERT");
PendingIntent pintent = PendingIntent.getBroadcast(Activity1.this, 1,
intent, 0);
The problem is, that I get this error message:
"No activity found to handle intent { action=app1.PROXIMITY_ALERT }"
I'm confused because this should not call an Activity but a
BroadcastReceiver.
If I send this intent as a broadcast my self, the BroadcastReceiver
receives this intent...
What is wrong with my code?
I tried to create an intent to call an Activity instead and registered
it to be send when reaching a location:
Intent intent = new Intent(Intent.ACTION_DEFAULT)
intent.setType("vnd.app1/activity1");
PendingIntent pintent = PendingIntent.getBroadcast(Activity1.this, 1,
intent, 0);
LocationManager lm =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
lm.addProximityAlert(latitude, longitude, radius, -1, pintent);
The problem is that the Activity is called immediately but NEVER if
the registered location is reached.
I'm working on a emulator and setting the gps coordinates using the
geo fix
command.
Can anyone help me with this problems
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---