0

如何从(添加)proximityalert 中获取意图到广播接收器中?以及如何使 onreceive 方法起作用?

Intent locationNotific = new Intent("SendProximityIntent");
    locationNotific.putExtra("RowID", id);
    sendBroadcast(locationNotific);
    PendingIntent lPendingIntent = PendingIntent.getActivity(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);
4

1 回答 1

1

如何从(添加)proximityalert 中获取意图到广播接收器中?

使用getBroadcast()而不是getActivity()提供Intent标识 manifest-registered BroadcastReceiver

于 2011-11-26T14:02:41.980 回答