question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

initial task is not executed

See original GitHub issue

I may be missing something here, but the initial task is completely skipped…

public class MHCTaskProvider extends TaskProvider  {

    private HashMap<String, Task> map  = new HashMap<>();

    public MHCTaskProvider(Context context){
        put(TASK_ID_INITIAL, createInitialTask(context));
        put(TASK_ID_CONSENT, ConsentTask.create(context, TASK_ID_CONSENT));
        put(TASK_ID_SIGN_IN, new SignInTask(context));
        put(TASK_ID_SIGN_UP, new SignUpTask(context));
    }

    @Override
    public Task get(String taskId) {
        return map.get(taskId);
    }

    @Override
    public void put(String id, Task task) {
        map.put(id, task);
    }

    private Task createInitialTask(Context context){
        List<Step> steps = new ArrayList<>();
        FormStep additionalInfoForm = new FormStep("MedicalInfo", "", "");
        additionalInfoForm.setStepTitle(R.string.task_inital_toolbar_title);

        //Height
        DecimalAnswerFormat heightFormat = new DecimalAnswerFormat(0, 210);
        QuestionStep heightStep = new QuestionStep("height", "Height", heightFormat);
        heightStep.setOptional(false);

        //Weight
        DecimalAnswerFormat weightFormat = new DecimalAnswerFormat(0, 150);
        QuestionStep weightStep = new QuestionStep("weight", "Weight", weightFormat);
        heightStep.setOptional(false);

        //What time do you generally wake up?
        DateAnswerFormat timeFormat = new DateAnswerFormat(AnswerFormat.DateAnswerStyle.Time);
        QuestionStep wakeupStep = new QuestionStep("wakeuptime", "What time do you generally wake up?", timeFormat);
        wakeupStep.setOptional(false);
        //What time do you generally go to sleep?
        QuestionStep sleepStep = new QuestionStep("sleeptime", "What time do you generally go to sleep?", timeFormat);
        sleepStep.setOptional(false);

        additionalInfoForm.setOptional(false);
        //additionalInfoForm.setFormSteps(heightStep, weightStep, wakeupStep, sleepStep);
        additionalInfoForm.setFormSteps(heightStep, weightStep);

        steps.add(additionalInfoForm);

        return new OrderedTask(TASK_ID_INITIAL, steps);
    }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dariosalviworkcommented, May 5, 2016

all right, fixed! it was my “dummy” Data Provider messing with it. Thanks!

0reactions
craynecommented, May 28, 2016

Thanks, that worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Task not executed ?! - FreeRTOS
Hello everybody ! I'm new in the world of FreeRTOS and I tried it on an Freescale HC12 card with the Help of...
Read more >
Task Scheduler not running, triggering or starting programs
In this article, we are covering some basic and useful steps to fix the Task Scheduler not running issue in Windows 11/10.
Read more >
Gradle task not executed if added as a dependency
1 Answer 1 ... I suppose the reason is within the phase when tasks are executed. tarTask is configured at the configuration phase...
Read more >
doFirst() does not execute first, but only after task execution
I am in the process of converting a plugin from Groovy to Java. I have a Groovy task: task dofirsttest(type: Exec) { doLast{...
Read more >
Task Scheduler not running or starting programs in Windows 10
While using Windows 10 on a regular basis, one can easily understand that the OS is a mixture of various background tasks and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found