()
| 78 | } |
| 79 | |
| 80 | private void create() { |
| 81 | if (owned) { |
| 82 | // Initialize |
| 83 | registry = new LifecycleRegistry(this); |
| 84 | registry.addObserver(new LifecycleObserver() { |
| 85 | @OnLifecycleEvent(Lifecycle.Event.ON_ANY) |
| 86 | public void onAny() { |
| 87 | Log.i(TwoStateOwner.this + " " + registry); |
| 88 | changed = new Date().getTime(); |
| 89 | state = registry.getCurrentState().name(); |
| 90 | } |
| 91 | }); |
| 92 | |
| 93 | setState(Lifecycle.State.CREATED); |
| 94 | synchronized (list) { |
| 95 | list.add(this); |
| 96 | } |
| 97 | } else |
| 98 | Log.e(TwoStateOwner.this + " not owned"); |
| 99 | } |
| 100 | |
| 101 | void start() { |
| 102 | Lifecycle.State state = registry.getCurrentState(); |
no test coverage detected