Android Java close derived Intent

I'm using Cordova Firebase plugin to handle the push notifications
The message is a JSON, if close is 0 the activity will start. But i can't close the derived intent if the close is 1.

For example:

public class FirebasePluginMessagingService extends FirebaseMessagingService {
    private static Intent doorbellIntent;
    public class FirebasePluginMessagingService extends FirebaseMessagingService {
        Map<String, String> data = remoteMessage.getData();

        for (Map.Entry<String, String> entry : data.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            Log.w(TAG, key + " - " + value);

        if (data.get("close").equals("1")){
            //This is what i'm need.
        Intent dialogIntent = new Intent(this, DoorBellRinging.class);
        Bundle bundle = new Bundle();
        bundle.putString("homeString", relevantHomeString);
        bundle.putInt("streamId", doorPhoneId);
        bundle.putBoolean("ring", true);
        doorbellIntent = dialogIntent;

Read more here:

Content Attribution

This content was originally published by benadzs at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: