Hi all,

So I got the Proximity Alerts working but I had to use the
PendingIntent.getActivity(HaiMap.this, i, newIntent,
PendingIntent.FLAG_CANCEL_CURRENT);

Does anyone have an idea on why this is not working on a Broadcast receiver.
I have seen many previous threads and all of them point to an issue with
Pending intents behaviour.

It sucks that Google cannot come up with better documentation on it. If
anyone has got Broadcast intents working for multiple proximity alerts then
it would be really good to know

Otherwise I will have to clobber my app to use an Activity to behave as just
a broadcast receiver.

The closest that anyone got seems to be in the below thread. I used the same
pattern as mentioned there but its not working now.

http://groups.google.com/group/android-developers/browse_thread/thread/e61ec1e8d88ea94d/8bdcec373c45f5b4


Regards,
Deepak





On Thu, Jul 28, 2011 at 12:35 AM, deepak subramanian
<[email protected]>wrote:

> Hi everyone,
>
> I have an application which needs to call a new screen if it comes within
> the proximity of a few locations. So I am using the addProximityAlerts()
> function as follows: But this does not work at all. My code is shown below
>
> *public void setupLocationMonitoring(Intent newIntent) {
>
>         for (int i = 0; i < locations.size(); i++) {
>             newIntent.putExtra("widgetId", i);
>             newIntent.setAction(IntentAction);
>             PendingIntent intent1= PendingIntent.getBroadcast(HaiMap.this,
> i, newIntent, PendingIntent.FLAG_CANCEL_CURRENT);
>             double lati=(double) (locations.get(i).getLatitudeE6()) / 1E6;
>             double longi =(double) (locations.get(i).getLongitudeE6()) /
> 1e6;
>             lm.addProximityAlert(lati,longi,200,0, intent1);
>         }
>     }
> *
> The Manifest entry for the broadbase receiver which is supposed to receive
> the intents is as follows;
> *
>   <receiver android:name="com.deepak.sample.receiver.MyBroadCastReceiver">
>             <intent-filter>
>                 <action
> android:name="com.deepak.sample.view.HaiMap.intentWiki"></action>
>             </intent-filter>
>   </receiver>*
>
>
> I am trying to create proximity alerts for a few locations with the
> following code. I have searched for some time but there is no good answer to
> this question anywhere on the web.
>
>
> Thanks and Regards,
> Deepak
>
>
>
>
>

-- 
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

Reply via email to