code: UploadTask getTask(Intent intent) {
          String taskClass = intent.getStringExtra(PARAM_TASK_CLASS);
  
          if (taskClass == null) {
              return null;
          }
  
          UploadTask uploadTask = null;
  
          try {
              Class<?> task = Class.forName(taskClass);
  
              if (UploadTask.class.isAssignableFrom(task)) {
                  uploadTask = UploadTask.class.cast(task.newInstance());
                  uploadTask.init(this, intent);
              } else {
                  Logger.error(TAG, taskClass + " does not extend UploadTask!");
              }
  
              Logger.debug(TAG, "Successfully created new task with class: " + taskClass);
  
          } catch (Exception exc) {
              Logger.error(TAG, "Error while instantiating new task", exc);
          }
  
          return uploadTask;
      }
docs: Creates a new task instance based on the requested task class in the intent.
  @param intent intent passed to the service
  @return task instance or null if the task class is not supported or invalid