Prevent crash

This commit is contained in:
M66B 2019-03-27 12:27:51 +00:00
parent c9b8bc64ff
commit e3f018aaa2
1 changed files with 3 additions and 0 deletions

View File

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