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

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. #57

Open
wsparse opened this issue Jun 20, 2018 · 2 comments

Comments

@wsparse
Copy link

wsparse commented Jun 20, 2018

大神,我在将项目移植到本地使用时,设置每页加载条数足够少(3条),在执行加载OnRequestDataListener中的onLoadMore()方法时,初始应该就是要连续两次执行加载更多的方法加载的数据才能够满屏使得BaseQuickAdapter中的mLoadingView不可见。但此时就会抛标题所述的异常。并且具体也没有在log日志中显示是哪行代码出这个异常。我猜想可能是 baseViewHolder = onCreateDefViewHolder(parent, viewType);出现这个异常。我本想在拷贝下的你的项目中来修改INCREASE_PAGE = 3;来重现一下,但page* INCREASE_PAGE来得到的数据我理解为本次请求的条数和你的项目中@get("nc/article/{type}/{id}/{startPage}-20.html")的startPage的意思好像有点不同,因此没能重现。另外若我设置每页加载5条在我的程序中就只需一次加载更多就能使数据满屏,此时就不会抛这个异常。希望能帮忙看看这是怎么回事。

@Rukey7
Copy link
Owner

Rukey7 commented Jun 22, 2018

从你说的情况应该就是两次加载出现问题,你可以看看这个项目,BaseRecyclerViewAdapterHelper,我是移植它的代码,我这个好久没更新了,用的是很早之前的,你用它新的版本跑下看会不会有这个问题

@wsparse
Copy link
Author

wsparse commented Jul 2, 2018

嗯,好的。才看到,回复晚了,不好意思哈。

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