Code example for LinkedList

Methods: isEmpty, remove

0
   * @param task download task instance 
   * @param request download request instance 
   */ 
  protected void onTaskFinish(final DownloadTask task, final Request request) {
    notificationManager.cancel(request.notificationId);
    tasks.remove(task);
    sendBroadcast(new Intent(ACTION_DOWNLOAD_COMPLETE).putExtra(EXTRA_ID, request.id).putExtra(EXTRA_SUCCESS, request.success));
    if (tasks.isEmpty()) { stopSelf(); }
  } 
 
  /** 
   * Download request. 
   * @author Roman Mazur (Stanfy - http://www.stanfy.com) 
   */ 
  public static class Request implements Parcelable {
 
    /** Creator. */ 
    public static final Creator<Request> CREATOR = new Creator<DownloadsService.Request>() {
      @Override 
      public Request createFromParcel(final Parcel source) { return new Request(source); } 
      @Override