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

阅读framgent,刷新某个tab下的数据为什么会做多次的请求 #8

Open
2022happynew opened this issue Jan 7, 2016 · 1 comment

Comments

@2022happynew
Copy link

No description provided.

@MummyDing
Copy link
Owner

因为根据你的描述为不能肯定确切原因,我列出想到的几点
1.因为我是使用的Pageradapter是FragmentPagerStateAdapter,它会加载当前fragment以及相邻的fragment,你说得多次也许只是它同时几个请求在请求其他页面的数据。
2.不过还有一种可能是因为我是先将数据从网络拉下来,存入数据库,再从数据库拉下来,这样界面展示数据的时候可能会出现数据多次加载的现象,但是网络请求并没有重复。
3.还有一种可能是你开启了自动刷新,当你从其他页面切换过来,后台是会自动请求数据的,然后你再受到强制刷一次,这样可能会出现两次重复请求。不过一般请求较快,不会如此。但这个地方确实需要改进

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

No branches or pull requests

2 participants