Ejemplo n.º 1
0
 @Override
 public void start() {
   publishProgress(-1, "");
   String terms =
       DataStore.pullTerms(mProject.getId(), mLanguage.getId(), mResource.getId(), false, false);
   AppContext.projectManager().loadTerms(terms, mProject);
 }
 /**
  * Begins a new download if one is not already in progress
  *
  * @param language
  */
 private void connectDownloadTask(SourceLanguage language) {
   String taskId = DOWNLOAD_LANGUAGE_PREFIX + mProject.getId() + "-" + language.getId();
   DownloadLanguageTask task = (DownloadLanguageTask) TaskManager.getTask(taskId);
   if (task == null) {
     // start new download
     task = new DownloadLanguageTask(mProject, language);
     TaskManager.addTask(task, taskId);
     // NOTE: the LibraryLanguageAdapter handles the onProgress and onFinish events
     mAdapter.notifyDataSetChanged();
   }
 }