0

I have the following receiver:

public class ActionAlertReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {

        createMap(intent);
    }

    public static void createMap(Intent intent) {


        Map<String, String> trackInfo = new HashMap<>();
        trackInfo.put(KEY_MESSAGE_ID, intent.getStringExtra(KEY_MESSAGE_ID));
        trackInfo.put(KEY_DELIVERY_ID, intent.getStringExtra(KEY_DELIVERY_ID));

    }


}

This is being called when someones click on a notification.

I need to send the map to a activity... how can I do that?

letsCode
  • 2,774
  • 1
  • 13
  • 37
  • You have intent object in onReceive method,so you can pass hashMap in intent and you need LocalBroadcast to send data to activity. – Kabir Aug 23 '19 at 15:39
  • 1
    Possible duplicate of [Passing Data from Broadcast Receiver to another Activity](https://stackoverflow.com/questions/9137477/passing-data-from-broadcast-receiver-to-another-activity) – Anas Mehar Aug 23 '19 at 15:49

0 Answers0