android开发时使用游标时一定要关闭
2013-10-17 15:08
344 查看
原代码如下:
places = getPlaceDatas(context, cursor);
cursor.close();
应改为:
try{
places = getPlaceDatas(context, cursor);
}finally{
cursor.close();
}
不然会报如下错误:
java.lang.IllegalStateException: Process 3188 exceeded cursor quota 100, will kill it
places = getPlaceDatas(context, cursor);
cursor.close();
应改为:
try{
places = getPlaceDatas(context, cursor);
}finally{
cursor.close();
}
不然会报如下错误:
java.lang.IllegalStateException: Process 3188 exceeded cursor quota 100, will kill it
相关文章推荐
- android开发时 使用android layout editor 打开xml时eclipse自动关闭
- android开发之数据库游标未关闭导致
- 为了避免android内存泄露,需要在使用完sql数据库游标(cursor)之后,关闭它!
- android开发 使用Action启动/关闭Service
- android开发之使用startActivityForResut获得打开的新窗体关闭后返回的数据
- Android开发 之 WebView的使用
- 【FastDev4Android框架开发】Android 数据缓存器ACache的详解和使用(四)
- Android开发当中Parcelable接口的使用
- Android开发之使用VideoView播放视频
- android笔记之安全开发之使用HTTPS
- Android开发:教你开发TVBox应用时使用遥控器组合快捷键
- Android 提示模拟器正在使用中,但是窗口已经关闭
- Android应用开发学习笔记04--使用布局
- android 传感器使用与开发----光线传感器
- 使用Google资源包core,另添加使用AndroidAnnotations注解开发框架
- UiOS开发中ITextView回收或关闭键盘使用方法总结
- Android应用开发之使用PhoneGap(cordova)实现拍照上传功能
- android开发Enum (枚举)的完美替代 —— @IntDef的使用
- Android开发使用Dom从网络端解析xml文件
- 【Android 开发】: Android客户端与服务端之间使用GSON交互数据。