Explicitly call `unbind()` in Activity if `ListenerClass` has valid `remover`???
See original GitHub issueif ListenerClass
implementation has a valid remover
, e.g. OnPageChange
and OnTextChanged
, the remover
method is added in the implementation of Unbinder.unbind()
method, by BindingSet.removerOrSetter()
method.
So, for Activities that reference ListenerClass
implementations with a valid remover
, I did not see a
explicit or implicit method to call the unbind()
method of ButterKnife.bind()
's return value.
I wonder if the remover
or unbind()
method would be automatically called? How if yes? If no, there would be memory leak.
I believe we MUST EXPLICITLY call Unbinder.unbind()
, where Unbinder
instance is returned by ButterKnife.bind()
, in Activities referencing any ListenerClass
with a valid remover
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Properly unbind service from activity - android - Stack Overflow
1 Answer 1 ... Call unbindService() on the same Context that you call bindService() on. Presumably, given the structure of your sample, you...
Read more >Camera API | Android Developers
unlock() calls are managed for you automatically. Unlike taking pictures with a device camera, capturing video requires a very particular call order. You...
Read more >30 Enabling ADF Security in a Fusion Web Application
Remove any grants to the test-all role for all ADF security-aware resources and replace with grants that you define. Because ADF resources are...
Read more >feature-remove-limitations PDF - MicroEJ Documentation
When selected, this option enables a dump of the heap each time the System.gc() method is called by the MicroEJ. Application. . ....
Read more >Web on Servlet Stack - Spring
DispatcherServlet. WebFlux. Spring MVC, as many other web frameworks, is designed around the front controller pattern where a central Servlet ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You only need to call
unbind()
in fragments inonDestroyView
because it can cause a leak if the fragment is re-used. For activities you do not need to call the method because the references form a cycle which will be correctly GC’d.@JakeWharton thanks