Gostaria de saber se é possível customizar um Notification com suas Actions.
Exemplo:
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.customnotification);
Notification.Builder builder = new Notification.Builder(this)
.setSmallIcon(R.drawable.ic_ico)
.setAutoCancel(true)
.setContentIntent(pIntent)
.setContent(remoteViews)
.addAction(R.drawable.ic_sim, "Sim", intent)
.addAction(R.drawable.ic_nao, "Não", outraIntent);
Quando
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.customnotification);
Notification.Builder builder = new Notification.Builder(this)
.setSmallIcon(R.drawable.ic_ico)
.setAutoCancel(true)
.setContentIntent(pIntent)
.setContent(remoteViews)
.addAction(R.drawable.ic_sim, "Sim", intent)
.addAction(R.drawable.ic_nao, "Não", outraIntent);
Quando removo o .addAction
, ele carrega corretamente, o content.
Mas quando incluo, ele exibe o layout padrão da Notification.
Desde já agradeço!