square / flow

Name UI states, navigate between them, remember where you've been.
Apache License 2.0
2.79k stars 241 forks source link

`Flow.get(context)` returns null during `Activity.onCreate` #258

Closed ScottPierce closed 7 years ago

ScottPierce commented 7 years ago

I'm configuring and installing Flow in attachBaseContext, and one of the issues that I keep running into, especially around creating objects that are tied to the Activity's lifecycle that want Flow in their constructor (or inject in their constructor), is that Flow.get() returns null / throws an error in normal parts of the Activity creation lifecycle.

This has bitten me several times in the past few months.

loganj commented 7 years ago

This is true, and not likely to change soon. It's documented as of #244. See also #211.