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

view can not add or remove again #38

Open
zwstyle opened this issue Nov 13, 2015 · 3 comments
Open

view can not add or remove again #38

zwstyle opened this issue Nov 13, 2015 · 3 comments

Comments

@zwstyle
Copy link

zwstyle commented Nov 13, 2015

first,i invoke addHeadView,then invoke removeHeadView,but when invoking addHeadView again, the app crash

@liaohuqiu
Copy link
Owner

Could you paste and backtrace here? :)

@Boomcollective
Copy link

11-15 16:51:45.902 3392-3392/com.ara.vmall E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ara.vmall, PID: 3392
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4309)
at android.view.ViewGroup.addView(ViewGroup.java:4145)
at android.view.ViewGroup.addView(ViewGroup.java:4086)
at android.view.ViewGroup.addView(ViewGroup.java:4059)
at com.ara.vmall.views.GridViewWithHeaderFooter.addFooterView(GridViewWithHeaderFooter.java:199)
at com.ara.vmall.views.GridViewWithHeaderFooter.addFooterView(GridViewWithHeaderFooter.java:180)
at com.ara.vmall.fragments.ProductListFragment.onRefresh(ProductListFragment.java:286)
at android.support.v4.widget.SwipeRefreshLayout$1.onAnimationEnd(SwipeRefreshLayout.java:187)
at android.support.v4.widget.CircleImageView.onAnimationEnd(CircleImageView.java:106)
at android.view.ViewGroup.finishAnimatingView(ViewGroup.java:6104)
at android.view.View.draw(View.java:16128)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16187)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16187)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at com.ara.vmall.slidingmenu.CustomViewAbove.dispatchDraw(CustomViewAbove.java:826)
at android.view.View.draw(View.java:16187)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16187)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16187)
at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer

@shaileshe2logy
Copy link

I am having same issue when adding footer in load more grid. When we delete footer view and add it again, it will give below error.

11-15 16:51:45.902 3392-3392/com.ara.vmall E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ara.vmall, PID: 3392
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4309)
at android.view.ViewGroup.addView(ViewGroup.java:4145)
at android.view.ViewGroup.addView(ViewGroup.java:4086)
at android.view.ViewGroup.addView(ViewGroup.java:4059)
at com.ara.vmall.views.GridViewWithHeaderFooter.addFooterView(GridViewWithHeaderFooter.java:199)
at com.ara.vmall.views.GridViewWithHeaderFooter.addFooterView(GridViewWithHeaderFooter.java:180)
at com.ara.vmall.fragments.ProductListFragment.onRefresh(ProductListFragment.java:286)
at android.support.v4.widget.SwipeRefreshLayout$1.onAnimationEnd(SwipeRefreshLayout.java:187)
at android.support.v4.widget.CircleImageView.onAnimationEnd(CircleImageView.java:106)
at android.view.ViewGroup.finishAnimatingView(ViewGroup.java:6104)
at android.view.View.draw(View.java:16128)

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

4 participants