@@ -0,0 +1,1117 @@
+package org.lagonette.android.app;%0A%0A%0Aimport android.arch.lifecycle.LifecycleOwner;%0Aimport android.arch.lifecycle.LiveData;%0Aimport android.arch.lifecycle.Observer;%0Aimport android.support.v4.util.ArrayMap;%0A%0Aimport java.util.concurrent.atomic.AtomicBoolean;%0A%0Apublic class SingleLiveEvent%3CT%3E extends LiveData%3CT%3E %7B%0A%0A    private AtomicBoolean mPending = new AtomicBoolean(false);%0A%0A    private ArrayMap%3CObserver%3CT%3E, Observer%3CT%3E%3E mObservers = new ArrayMap%3C%3E();%0A%0A    @Override%0A    public void observe(LifecycleOwner owner, Observer%3CT%3E observer) %7B%0A        Observer%3CT%3E wrappedObserver = it -%3E %7B%0A            if (mPending.compareAndSet(true, false)) %7B%0A                observer.onChanged(it);%0A            %7D%0A        %7D;%0A        mObservers.put(observer, wrappedObserver);%0A        super.observe(owner, wrappedObserver);%0A    %7D%0A%0A    @Override%0A    public void removeObserver(Observer%3CT%3E observer) %7B%0A        super.removeObserver(mObservers.get(observer));%0A    %7D%0A%0A    @Override%0A    protected void setValue(T value) %7B%0A        mPending.set(true);%0A        super.setValue(value);%0A    %7D%0A%0A    public void call() %7B%0A        setValue(null);%0A    %7D%0A%0A%7D

Add SingleLiveEvent