code: public static Callable<?> getTaskFromExtras(final Intent intent) {
      if (!intent.hasExtra(EXTRA_TASK) && !intent.hasExtra(EXTRA_TASK_BUNDLE)) {
        return null;
      }
  
      Parcelable taskArg = intent.getParcelableExtra(EXTRA_TASK);
      if (taskArg == null) {
        Bundle bundle = intent.getBundleExtra(EXTRA_TASK_BUNDLE);
        if (bundle != null) {
          taskArg = bundle.getParcelable(EXTRA_TASK);
        }
      }
  
      if (!(taskArg instanceof Callable)) {
        throw new IllegalArgumentException("Task " + taskArg + " is not a Callable");
      }
  
      return (Callable<?>)taskArg;
    }
docs: Get a task instance packed into an {@code Intent} with
  {@link #taskIntent(android.content.Context, java.util.concurrent.Callable)}.