Android Weak Reference of Inner Class

别来无恙 提交于 2019-12-03 16:27:31

If you only use the Adapter object within the GalleryVideo activity, you don't need to use a weak reference.

Your code snippet is memory-leak safe, it depends on what you do with those objects outside that snippet though whether your application is.

Just make sure that no object created within an Activity that has a reference to that Activity (that especially includes non-static inner classes and anonymous classes) leaves the Activity.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!