0

我无法获得我放入意图中的额外内容,即我放入“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);

广播接收器:

public void onReceive(Context context, Intent intent) {


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

1 回答 1

0

尝试FLAG_UPDATE_CURRENT在您的getBroadcast()通话中使用,将您的额外内容与之前任何PendingIntent相同核心的任何内容合并Intent

于 2011-12-02T23:27:40.773 回答