Я не могу получить дополнения, которые я включил в намерение, которые я вставил в «addProximityAlert» - PullRequest
0 голосов
/ 02 декабря 2011

Я не могу получить дополнения, которые я включил в намерение, которые я добавил в "addProximityAlert"

locationNotific.putExtra("name", "ofek");

   // sendBroadcast(locationNotific); (I can get the extras)

    PendingIntent lPendingIntent = PendingIntent.getBroadcast(this, 0, locationNotific, 0);

       IntentFilter filter = new IntentFilter("SendProximityIntent"); 

       registerReceiver(new ProximityIntentReceiver(), filter);


    lm.addProximityAlert((double) locationAlertGeoP.getLatitudeE6(),(double) locationAlertGeoP.getLongitudeE6(), (float) 999999999,(long) 100000,lPendingIntent);

BroadcastReceiver:

public void onReceive(Context context, Intent intent) {


    IDForNotificationString = intent.getStringExtra("name");
    //MA.notification(IDForNotificationString);

1 Ответ

0 голосов
/ 03 декабря 2011

Попробуйте использовать FLAG_UPDATE_CURRENT в вашем getBroadcast() вызове, чтобы объединить ваши дополнения с любым, что было в любом предыдущем PendingIntent для этого же ядра Intent.

...