Android – does holding an interface implemented by an activity cause a memory leak?

I have an activity that implements the interface and an asynctask that uses the interface to update the status. As far as I know, if aynctask holds a reference to the activity and the activity will lead to memory leakage, but if aynctask only holds part of the memory, that is, the interface, will it also lead to memory leakage?

resolvent:

Yes, it will. The interface just defines the methods provided by some objects. It is still a reference to the original object

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>