1. Shanmugapriya D's Avatar
    Expecting : I am displaying more than one notification in Notification bar. In this notification i have three button like 1, 2 and 3. From the notification if click 1 button then it has to go the first activity if click 2 button it has to go second activity same like 3 button also.

    But i am stuck below:

    1. displaying more than one notification => No problem 2. But if i click 1 st button it is going the 1st activity.(Now app is opening) again when i click the 1 st button some other notification as displayed in notification status bar it not opening the 1st activity

    @Override
    protected boolean onNotificationOpened(@NonNull Context context, @NonNull NotificationInfo notificationInfo, @NonNull ActionButtonInfo actionButtonInfo) {
    Log.i(TAG, "Notification action button opened. Button ID: " + actionButtonInfo.getButtonId() + ". NotificationId: " + notificationInfo.getNotificationId());
    Toast.makeText(context.getApplicationContext(),"Button Click",Toast.LENGTH_LONG).show();
    Log.e("@@@@@@@ID", String.valueOf(notificationInfo.getNotificationId()));
    Log.e("$$", String.valueOf(notificationInfo.getMessage().getAlert()));
    Log.e("eGSSSHKJHSHJS", (String) notificationInfo.getMessage().getPushBundle().get("AlarmJson"));
    String pushjson=(String) notificationInfo.getMessage().getPushBundle().get("AlarmJson");
    ***if(actionButtonInfo.getButtonId()!=null && actionButtonInfo.getButtonId().equalsIgnoreCase("Graph")) {
    Log.e("Graph","You clicked Graph");
    Toast.makeText(context.getApplicationContext(),"Graph Click",Toast.LENGTH_LONG).show();
    Intent i = new Intent(context.getApplicationContext(), **ResultActivity**.class);
    i.putExtra("From", "from@@#graphicViewRoute");
    i.putExtra("Pushjson","json@@"+pushjson);
    //i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_CLEAR_TOP |Intent.FLAG_ACTIVITY_SINGLE_TOP);
    context.startActivity(i);
    return true;***

    }
    else if(actionButtonInfo.getButtonId()!=null && actionButtonInfo.getButtonId().equalsIgnoreCase("DD"))
    {
    Log.e("DD","You clicked DD");
    Intent i = new Intent(context.getApplicationContext(), **ResultActivity**.class);
    i.putExtra("From", "from@@#ddviewRoute");
    i.putExtra("Pushjson","json@@"+pushjson);
    i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
    i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(i);

    return true;

    }

    // Return false here to allow Urban Airship to auto launch the launcher
    // activity for foreground notification action buttons
    return false;
    }
    12-13-2016 06:28 AM
LINK TO POST COPIED TO CLIPBOARD