title: Android Push Notifications: Icon not displaying in notification, white square shown instead
body: <p>My app generates a notification, but the icon I set for that notification is not being displayed. Instead, I get a white square.</p>
  <p>I have tried resizing the png of the icon (dimensions 720x720, 66x66, 44x44, 22x22). Curiously, when using smaller dimensions the white square is smaller.</p>
  <p>I have googled this problem, as well as the correct way of generating notifications, and from what I've read my code should be correct. Sadly things are not as they should be.</p>
  <p>My phone is a Nexus 5 with Android 5.1.1. The problem is also present on emulators, a Samsung Galaxy s4 with Android 5.0.1 and a Motorola Moto G with Android 5.0.1 (both of which I borrowed, and don't have right now)</p>
  <p>The code for notifications follows, and two screenshots. If you require more information, please feel free to ask for it.</p>
  <p>Thank you all.</p>
  <pre><code>@SuppressLint(&quot;NewApi&quot;) private void sendNotification(String msg, String title, String link, Bundle bundle) {
      NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
      Intent resultIntent = new Intent(getApplicationContext(), MainActivity.class);
      resultIntent.putExtras(bundle);
      PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
              resultIntent, Intent.FLAG_ACTIVITY_NEW_TASK);
      Notification notification;
      Uri sound = Uri.parse(&quot;android.resource://&quot; + getPackageName() + &quot;/&quot; + R.raw.notificationsound);
      notification = new Notification.Builder(this)
                  .setSmallIcon(R.drawable.lg_logo)
                  .setContentTitle(title)
                  .setStyle(new Notification.BigTextStyle().bigText(msg))
                  .setAutoCancel(true)
                  .setContentText(msg)
                  .setContentIntent(contentIntent)
                  .setSound(sound)
                  .build();
      notificationManager.notify(0, notification);
  }
  </code></pre>
  <p><img src="https://i.stack.imgur.com/MoPh0.png" alt="without opening the notification" />
  <img src="https://i.stack.imgur.com/3IVm3.png" alt="notifications opened" /></p>