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

Timing issue for Flow.get() #91

Closed
hijamoya opened this issue May 19, 2015 · 1 comment
Closed

Timing issue for Flow.get() #91

hijamoya opened this issue May 19, 2015 · 1 comment

Comments

@hijamoya
Copy link

Hi, I encounter a problem.
I call Flow.get(context) in onLoad of the first path and it will lead to a NullPointerException.
Since when we call in MainActivity:

flowSupport = FlowDelegate.onCreate(nonConfig, getIntent(), savedInstanceState, parceler,
        History.single(new Paths.ConversationList()), this);

The first path "Paths.ConversationList()" will be created and its onLoad is called in FlowDelegate's onCreate():

  flow = new Flow(selectHistory(intent, savedHistory, defaultHistory, parceler));

But we return the flowSupport two lines after.
We can't get the flow services in that time since flowSupport is null:

  @Override public Object getSystemService(String name) {
    Object service = null;
    if (flowSupport != null) {
      service = flowSupport.getSystemService(name);
    }
    return service != null ? service : super.getSystemService(name);
  }

any good suggestion?

Many Thanks

@hijamoya hijamoya changed the title Timing for Flow.get() Timing issue for Flow.get() May 19, 2015
@loganj
Copy link
Collaborator

loganj commented Feb 8, 2016

This should be resolved on master (and in the next release). We're no longer using FlowSupport or FlowDelegate. Lifecycle and initialization are much better managed.

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

2 participants