android中关于Sqlite的问题
16lz
2021-01-23
1.不要在UI线程里调用getReadableDatabase ()或者getWritableDatabase ()方法
参见androidAPI文档如下:
Create a helper object to create, open, and/or manage a database. This method always returns very quickly. The database is not actually created or opened until one of getWritableDatabase() or getReadableDatabase() is called.
LikegetWritableDatabase()
, this method may take a long time to return, so you should not call it from the application main thread, including fromContentProvider.onCreate()
.
Database upgrade may take a long time, you should not call this method from the application main thread, including fromContentProvider.onCreate()
.
更多相关文章
- 开始学习、翻译android文档
- Android非UI线程访问UI线程的方法总结
- Android Fresco图片处理库用法API英文原文文档2-1(Facebook开源An
- FregServer进程,发送BC_TRANSACTION,唤醒ServiceManager进程,返回BR
- 在非主线程中不能操作主线程中的View
- Android官方技术文档翻译—— Eclilpse项目迁移
- Android - 多线程 - AsyncTask
- 【Android Developers Training】 53. 打印HTML文档
- Android Kernel Porting 的简单总结文档