Not able to change Icon in android studio using setsmallIcon in NotificationCompat.Builder
below is the code which i am trying and testing it on android 10
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
getFirebaseMessage(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
}
public void getFirebaseMessage(String title, String msg){
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "myFirebaseChannel")
.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher))
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(msg)
.setAutoCancel(true);
NotificationManagerCompat managerCompat = NotificationManagerCompat.from(this);
managerCompat.notify(101, builder.build());
}
}