我无法获得我投入到意图中的额外内容,我将其放入" addProximityAlert"

时间:2011-12-02 17:40:27

标签: java android methods android-intent proximity

我无法获得我投入意图的额外内容,我放入“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 :(得分:0)

尝试在FLAG_UPDATE_CURRENT来电中使用getBroadcast(),将您的额外内容与之前任何PendingIntent内的任何内容合并为同一个核心Intent