1
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.ic_launcher)
            .setLargeIcon(b)
            .setContentTitle("this a message!")
            .setContentText("Hello world");

can I use only setLagreIcon() or any other alternative solution?

anynew
  • 217
  • 2
  • 8

1 Answers1

0

From documentation:

A Notification object must contain the following:

  • A small icon, set by setSmallIcon()
  • A title, set by setContentTitle()
  • Detail text, set by setContentText()

So no, this is not possible.

Edit: A really unsafe and not recommended method seems to be explained here.

Community
  • 1
  • 1
yennsarah
  • 5,467
  • 2
  • 27
  • 48
  • I have seen the documentation. but I discover that many other app's notification are displayed only large bitmap.can you explain the issue?thanks ! – anynew Dec 11 '15 at 08:56
  • Are you sure they only use the `largeIcon`? I know there are many issues with a non white small icon. I added a method to accomplish this in my answer, I have not tried it myself. – yennsarah Dec 11 '15 at 09:05