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 Webview基本配置以及android与js交互
  2. Android(安卓)实现闪屏页和右上角的倒计时跳转
  3. Android作为CXF客户端调用服务端。
  4. Android(安卓)Audio代码分析13 - AudioTrack::getPosition函数
  5. 获取未安装的APK图标
  6. 在Android中实现多线程同步
  7. popwindow动画显示消失,activity切换动画
  8. Android(安卓)调用系统的分享[完美实现同时分享图片和文字]
  9. Android(安卓)学习笔记--android――Activity生命周期,server,Br

随机推荐

  1. Android Firebase Dynamic Links 动态链
  2. 关于安卓 TextView 添加点击事件
  3. Android(安卓)studio的NDK配置
  4. 安卓 相对布局属性大全
  5. Android(安卓)Studio启动崩溃的问题:Start
  6. android屏幕页面实现滚动,页面跳…
  7. Android(安卓)获取并解析网络XML与数据上
  8. Android Studio创建Android Library发布
  9. Android NDK 的学习之旅-----JNI LOG 打
  10. ubuntu 64 adb 识别android设备