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