开发者

When should I close the DatabaseHelper?

With reference to this link, when is a good time to close the connection if you only have one connection? I have 开发者_JAVA百科a service running in the background at all times. When is a good time to call the close() function? Any suggestions?


You do not actually have to call close(). For example, if you implement a content provider, there is no opportunity to call close(). We have been told that, due to the way SQLite is implemented, not calling close() will not cause any particular problem.

That being said, you really should reconsider having "a service running in the background too all the time".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜