android没有关闭游标的缺点 [英] android disadvantages of not closing cursor
本文介绍了android没有关闭游标的缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对 Cursor
有一些疑问。
我想知道不关闭a的缺点是什么光标
?
I want to know what are the disadvantages of not closing a Cursor
?
它取消分配资源,但是哪些资源被解除分配?
It deallocates resources, but what resources are deallocated?
如果我们不关闭 Cursor
?会有什么后果和程度?
If we do not close the Cursor
? What will be the consequences and to what extent?
不关闭光标
不会影响活动
a bit,但它在log cat中出错。
Not closing a Cursor
does not affect Activity
a bit, but it gives error in a log cat.
推荐答案
关闭光标
将避免任何潜在的内存泄漏,因此是它们应该在不再使用时始终关闭。
Closing a Cursor
will avoid any potential memory leaks, so YES they should always be closed when no longer used.
这篇关于android没有关闭游标的缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文