title: where to place the foreground() method
body: <p>I'm trying to run a service which gives notification, if available every few minutes. Since the service will get destroyed after few hours, I thought of making it foreground service. But if I do so, it shows two notification. One is notification column(Thats what I need and got). Another one on Ongoing column which shows icon that work go at all. Its really annoying. The notification code goes like this</p>
  
  <p>Notification.java</p>
  
  <pre><code>n.setLatestEventInfo(getApplicationContext(), "Update", "new update arrived", pIntent);
  n.flags = Notification.FLAG_AUTO_CANCEL;
  startForeground(2233,n);
  n.flags |=Notification.FLAG_NO_CLEAR;
  NM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  NM.notify(id,n);
  </code></pre>