我无法获得我投入意图的额外内容,我放入“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);
答案 0 :(得分:0)
尝试在FLAG_UPDATE_CURRENT
来电中使用getBroadcast()
,将您的额外内容与之前任何PendingIntent
内的任何内容合并为同一个核心Intent
。