Optimization

pull/178/head
M66B 5 years ago
parent c8efa741fa
commit 5067f4b1f5

@ -66,12 +66,14 @@ public class TwoStateOwner implements LifecycleOwner {
}
void start() {
if (!registry.getCurrentState().equals(Lifecycle.State.DESTROYED))
Lifecycle.State state = registry.getCurrentState();
if (!state.equals(Lifecycle.State.STARTED) && !state.equals(Lifecycle.State.DESTROYED))
setState(Lifecycle.State.STARTED);
}
void stop() {
if (!registry.getCurrentState().equals(Lifecycle.State.DESTROYED))
Lifecycle.State state = registry.getCurrentState();
if (!state.equals(Lifecycle.State.CREATED) && !state.equals(Lifecycle.State.DESTROYED))
setState(Lifecycle.State.CREATED);
}

Loading…
Cancel
Save