Skip to content
New issue

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

在fragment中使用问题 #150

Open
caobin821651400 opened this issue Dec 24, 2019 · 1 comment
Open

在fragment中使用问题 #150

caobin821651400 opened this issue Dec 24, 2019 · 1 comment

Comments

@caobin821651400
Copy link

场景,mainactivity中有四个fragment banner在首页展示,当我切换到第四个fragment中,并点击跳转到其他activity中,在返回来到第四个fragment时banner会自动执行startAutoPlay(),此时首页并没有展示,这样会浪费资源。

断点是这段代码导致的
@OverRide
protected void onVisibilityChanged(@nonnull View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (VISIBLE == visibility) {
startAutoPlay();
} else if (GONE == visibility || INVISIBLE == visibility) {
onInvisibleToUser();
}
}

@xiaohaibin
Copy link
Owner

了解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants