Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
参考这个链接,如果你只有一个连接,什么时候是关闭连接的好时机?我一直在后台运行一项服务。什么时候是调用close()函数的好时机?有什么建议么?
close()
您实际上不必调用close(). 例如,如果您实现内容提供程序,则没有机会调用close(). 我们被告知,由于 SQLite 的实现方式,不调用close()不会导致任何特定问题。
话虽如此,您确实应该重新考虑“始终在后台运行服务”。