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().

更多相关文章

  1. 开始学习、翻译android文档
  2. Android非UI线程访问UI线程的方法总结
  3. Android Fresco图片处理库用法API英文原文文档2-1(Facebook开源An
  4. FregServer进程,发送BC_TRANSACTION,唤醒ServiceManager进程,返回BR
  5. 在非主线程中不能操作主线程中的View
  6. Android官方技术文档翻译—— Eclilpse项目迁移
  7. Android - 多线程 - AsyncTask
  8. 【Android Developers Training】 53. 打印HTML文档
  9. Android Kernel Porting 的简单总结文档

随机推荐

  1. mac 下启动Android(安卓)Studio 时出现 A
  2. Android(安卓)计算器编程实现
  3. android studio导入jar 后产生的 gradle
  4. Android——文件操作
  5. Android(安卓)Studio编译中“png-crunche
  6. Android学习笔记 --- Terms and installa
  7. Android(安卓)uiautomator 使用入门官方
  8. Android的权限permission
  9. android在java代码中绘制矩形框
  10. Android(安卓)ListView(Selector 背景图片