android 4.0 以上平台选择图片报错Attempted to access a cursor after it has been closed.

android.database.StaleDataException: Attempted to access a cursor after it has been closed.at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2444)at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2472)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1173)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4424)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)at dalvik.system.NativeStart.main(Native Method)Caused by: android.database.StaleDataException: Attempted to access a cursor after it has been closed.

 4.0以上平台会自动关闭cursor

  //4.0以上的版本会自动关闭 (4.0--14;; 4.0.3--15)                  if(Integer.parseInt(Build.VERSION.SDK) < 14)                  {                      cursor.close();                  }  

更多相关文章

  1. Android 系统信息获取(CPU,RAM,ROM,Battery,SD-card,版本等)
  2. Notification用法,注意API版本,API大于11的setLatestEventInfo()方
  3. Android 平台上玩DOS游戏
  4. 《Android 获取当前app的版本号和版本名称》
  5. Android P 以及之后版本不支持同时从多个进程使用具有相同数据目
  6. 拥抱Android:编译nodejs搭建移动平台
  7. Android Sqlite数据库跨版本升级 保存之前数据
  8. 探索 Android 平台的 CameraX
  9. Android多平台推送

随机推荐

  1. Android程序结构分析
  2. Android常用动画alpha和rotate同时使用
  3. SQlite与android 的数据交互 (android 项
  4. Android(安卓)Dialog
  5. 修改android版本号
  6. Android(安卓)接受Home key Event
  7. Android4.4——service之bindService
  8. android AMR-NB
  9. Android(安卓)之 WebView的使用介绍
  10. Android(安卓)Run ERROR: Unknown option