I need to create alerts with two buttons (Analogue in VK, when the request for adding friends comes). Googling, found this:

Notification n = new Notification.Builder(this) .setContentTitle("New mail from " + "test@gmail.com") .setContentText("Subject") .setSmallIcon(R.drawable.icon) .setContentIntent(pIntent) .setAutoCancel(true) .addAction(R.drawable.icon, "Call", pIntent) .addAction(R.drawable.icon, "More", pIntent) .addAction(R.drawable.icon, "And more", pIntent).build(); 

The problem is that by creating this way, an error is displayed. Eclipse doesn't even suggest using addAction.

    1 answer 1

    Poor google @ Maria_1

    It is necessary to do custom layout. See an example here.

    .addAction() works only with support package or starting from some API level.