Prevent crash

pull/153/head
M66B 6 years ago
parent c9b8bc64ff
commit e3f018aaa2

@ -10,8 +10,11 @@ import androidx.lifecycle.OnLifecycleEvent;
public class TwoStateOwner implements LifecycleOwner { public class TwoStateOwner implements LifecycleOwner {
private LifecycleRegistry registry; private LifecycleRegistry registry;
// https://developer.android.com/topic/libraries/architecture/lifecycle#lc
TwoStateOwner() { TwoStateOwner() {
registry = new LifecycleRegistry(this); registry = new LifecycleRegistry(this);
registry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
} }
TwoStateOwner(LifecycleOwner owner) { TwoStateOwner(LifecycleOwner owner) {

Loading…
Cancel
Save