Been wrestling with this for a couple of days now. Thought something was
wrong with my code but I think it has to do with the API level.
I was testing using Intellij IDEA on OSX when I first couldn't solved the
problem. In a last-ditch effort, I ran the code on my Windows machine with
Eclipse and it worked perfectly fine.
After some testing, it seems to be that the culprit is API 17. It works on
16, no matter the environment.
*AndroidManifest.xml*
> <uses-sdk
>
> android:minSdkVersion="8"
>
> android:targetSdkVersion="17" />
>
>
*Code I used to register for the alert broadcast*
> private void addFence() {
LocationManager locManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
> Intent intent = new Intent(PROXIMITY_ALERT_INTENT);
intent.putExtra(INTENT_LOC_NAME, "Somewhere");
> PendingIntent pendingIntent = PendingIntent.getBroadcast(
this, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
> locManager.addProximityAlert(
43.64767, -79.39631, 2000, -1, pendingIntent);
> IntentFilter filter = new IntentFilter(PROXIMITY_ALERT_INTENT);
registerReceiver(new ProximityIntentReceiver(), filter);
*Emulator settings that don't work*
<https://lh3.googleusercontent.com/-YBgCdwD4BIQ/UMNQ9r9BXmI/AAAAAAAAAGQ/ic0MnlHJy2c/s1600/Screen+Shot+2012-12-08+at+9.37.52+AM.png>
*
*
--
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