コード例 #1
0
  /** Start a background task that exports all books to goodreads. */
  private void sendToGoodreads(boolean updatesOnly) {

    if (!checkCanSendToGoodreads()) return;

    QueueManager.getQueueManager()
        .enqueueTask(new SendAllBooksTask(updatesOnly), BcQueueManager.QUEUE_MAIN, 0);
    Toast.makeText(
            AdministrationFunctions.this,
            R.string.task_has_been_queued_in_background,
            Toast.LENGTH_LONG)
        .show();
  }
コード例 #2
0
  /** Start a background task that imports books from goodreads. */
  private void importAllFromGoodreads(boolean isSync) {

    if (BcQueueManager.getQueueManager().hasActiveTasks(BcQueueManager.CAT_GOODREADS_IMPORT_ALL)) {
      Toast.makeText(this, R.string.requested_task_is_already_queued, Toast.LENGTH_LONG).show();
      return;
    }
    if (BcQueueManager.getQueueManager().hasActiveTasks(BcQueueManager.CAT_GOODREADS_EXPORT_ALL)) {
      Toast.makeText(this, R.string.export_task_is_already_queued, Toast.LENGTH_LONG).show();
      return;
    }

    if (!checkGoodreadsAuth()) return;

    QueueManager.getQueueManager()
        .enqueueTask(new ImportAllTask(isSync), BcQueueManager.QUEUE_MAIN, 0);
    Toast.makeText(
            AdministrationFunctions.this,
            R.string.task_has_been_queued_in_background,
            Toast.LENGTH_LONG)
        .show();
  }