Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It doesn't Perform the job after fragment or activity resume. #4

Open
ahmadalibaloch opened this issue Mar 10, 2015 · 0 comments
Open

Comments

@ahmadalibaloch
Copy link

I am in a AppDrawerNavigator Fragment. In my OnCreateView of the fragment I have a method LoadEmployeeJobs. This is the body of that method.

  TinyTask.perform(new Something<List<Job>>() {
        @Override
        public List<Job> whichDoes() throws Exception {
            return sj.getByTodayByEmployeeId(userLoggedInId);
            // sj is a Retrofit service which is initalized in OnCreate of the fragment and Its not null
            // when the problem occurs. That is I close and resume the app or go to another fragment
            // and come back and I see no reloading of the jobs. I see in debugger it dont come in 
           // WhenDone but it do come in the LoadEmployeeJobs method.
        }
    }).whenDone(new DoThis<List<Job>>() {
        @Override
        public void ifOK(List<Job> jobs ) {
            BusProvider.getInstance().post(new EmployeeJobsLoadedEvent(jobs));
        }

        @Override
        public void ifNotOK(Exception e) {
            Crouton.showText(getActivity(), "Problem loading employee jobs", Style.ALERT);
        }
    }).go();

Instead of Tiny Task I added an Async task default android and it works like a charm on every load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant