title: foreground service does not persist when app is closed from background tray
body: <p>I'm running foreground service and its notification disappears when the app is removed from recent apps tray.
  I want to send data from database to server even when app is closed from recent app tray. How can I achieve this?</p>
  
  <p>Code to display notification:</p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, int flags, int startId) {
      Log.d(TAG, "onStartCommand executed");
      context = AppController.getInstance().getApplicationContext();
      if (intent.getAction().equals("com.truiton.foregroundservice.action.startforeground")) {
          Intent notificationIntent = new Intent(this, MainActivity.class);
          notificationIntent.setAction("com.truiton.foregroundservice.action.main");
          notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                  | Intent.FLAG_ACTIVITY_CLEAR_TASK);
          PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
                  notificationIntent, 0);
  
          Intent previousIntent = new Intent(this, ConnectivityCheckReceiver.class);
          previousIntent.setAction("com.truiton.foregroundservice.action.prev");
          PendingIntent ppreviousIntent = PendingIntent.getService(this, 0,
                  previousIntent, 0);
  
          Bitmap icon = BitmapFactory.decodeResource(getResources(),
                  R.mipmap.ic_launcher);
  
          Notification notification = new NotificationCompat.Builder(this)
                  .setContentTitle("Truiton Music Player")
                  .setTicker("Truiton Music Player")
                  .setContentText("My Music")
                  .setSmallIcon(R.mipmap.ic_launcher)
                  .setLargeIcon(
                          Bitmap.createScaledBitmap(icon, 128, 128, false))
                  .setContentIntent(pendingIntent)
                  .setOngoing(true)
                  .addAction(android.R.drawable.ic_media_previous,
                          "Previous", ppreviousIntent)
                  .build();
          startForeground(101,
                  notification);
      }
      return START_STICKY;
  }
  </code></pre>