I've created a method to encapsulate a notification message (% with%). An excerpt of the code is shown below:
public void exibirMensagem(String titulo, String texto,Drawable icone)
{
Notification.Builder mensagem = new Notification.Builder(contexto)
//TROCAR PARA O ÍCONE PADRÃO DA APLICACAO
.setSmallIcon(icone);}
It turns out that the Notification.Builder
method does not accept the icone object that was passed by parameter. icone is underlined in red and when I pass the mouse cursor the following message appears:
Can not resolved method 'setSmallIcon (android.graphics.drawable.Drawable
How can I solve this, ie pass a Drawable as a parameter and use in the .setSmallIcone
method?