title: how to reset badge count when android app opens on android
body: <p>After I open the App, I want the badge count to be removed. Right now, it only gets removed when I open the App via the Push message in the lock screen. The push message then gets removed from the lock screen, so I could also phrase this question as "How to remove push message from lock screen".</p>
  
  <p>With this code I can retrieve the notification:</p>
  
  <pre><code>@Override
  protected void onStart() {
      super.onStart();
      NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
      if (android.os.Build.VERSION.SDK_INT &gt;= android.os.Build.VERSION_CODES.M) {
          StatusBarNotification[] notifications = notificationManager.getActiveNotifications();
          for (StatusBarNotification statusBarNotification : notifications) {
              statusBarNotification.getNotification().number = 0;
          }
      }
  }
  </code></pre>
  
  <p>But nothing happens when settings the number to 0.</p>