-
Notifications
You must be signed in to change notification settings - Fork 90
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
onDetachedFromWindow is called twice #95
Comments
+1 |
Could you please give a bit more context? Are these renderable views located inside other renderable views? Or maybe they are adapter items? Or are they mounted directly into the activity? FYI, in the upcoming Anvil 0.5.0 (see |
For the stack trace, please see the first reply of #82, I've seen it before.
|
any workaround??? |
I'm not sure how this issue has been affected by Anvil 0.5.1, but there is now an option to call |
The problem comes with recyclerview. The only solution, i think, is create a Custom Renderable View and put "Anvil.unmout(this,false)" inside "onDetachedFromWindow" |
Hm.. So RecyclerView injects some child views on its own, then during the unmount() call we remove its child views and when it tries to do the same - it crashes. I wonder if custom |
I'm getting the same exception as @iciakky
I'm rewriting my best practices/example app to use Anvil instead of RxBinding and this is blocking me. |
See this bug report filed on the Android issue tracker: https://issuetracker.google.com/issues/38375597 If you star it, maybe it'll get more attention and get fixed. |
In my case I could fix it without modifying the recyclerview or downgrading the version and on my onDetachedFromWindow I have this:
It works like a charm. |
support-v7:27.1.0 fix this bug |
@meikaiss are you sure? it it still void someone said |
@meikaiss i am sry,recyclerview27.1.0 fixed the mGapWorker is null |
The method "onDetachedFromWindow" of RenderableView is called twice,this will cause some exceptions.
For example, RecyclerView will throw NullPointerException, for mGapWorker was set to null at the first time.
The text was updated successfully, but these errors were encountered: