We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` public static class LiveBusData extends MutableLiveData {
private boolean isFirstSubscribe; LiveBusData(boolean isFirstSubscribe) { this.isFirstSubscribe = isFirstSubscribe; } @Override public void observe(@NonNull LifecycleOwner owner, @NonNull Observer<T> observer) { super.observe(owner, new ObserverWrapper<>(observer, isFirstSubscribe)); } } private static class ObserverWrapper<T> implements Observer<T> { private Observer<T> observer; private boolean isChanged; private ObserverWrapper(Observer<T> observer, boolean isFirstSubscribe) { this.observer = observer; isChanged = isFirstSubscribe; } @Override public void onChanged(@Nullable T t) { if (isChanged) { if (observer != null) { observer.onChanged(t); } } else { isChanged = true; } } }`
问题再isChanged 和 isFirstSubscribe 标志位上,请修改~
The text was updated successfully, but these errors were encountered:
No branches or pull requests
` public static class LiveBusData extends MutableLiveData {
问题再isChanged 和 isFirstSubscribe 标志位上,请修改~
The text was updated successfully, but these errors were encountered: