Search code examples
javaandroidmethodsalertproximity

how to get the intent from the (add)proximityalert into a broadcastreceiver?


how to get the intent from the (add)proximityalert into a broadcastreceiver? and how to make the onreceive method to work?

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);

Solution

  • how to get the intent from the (add)proximityalert into a broadcastreceiver?

    Use getBroadcast() instead of getActivity() and supply an Intent identifying a manifest-registered BroadcastReceiver.