如何在code IllegalStateException异常处理上的光标? [英] How to Handle in code IllegalStateException on Cursor?

查看:138
本文介绍了如何在code IllegalStateException异常处理上的光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调试我的应用程序突然这个错误弹出。
我该如何处理这种错误的?

我不知道在哪里以及如何造成的。

 守护系统线程并[d 5个HeapWorker](吊(例外IllegalStateException异常))
    SQLiteCursor.finalize()行:603
    NativeStart.run()行:不可用[本机方法]


解决方案

使用managedQuery()函数来查询数据。如果你使用managedQuery()而不是查询(),那么活动将保持光标参考,并自动关闭时,不使用它。

When I was debugging my application suddenly this error popup. How can I handle this kind of error?

I don't know where and how is caused.

Daemon System Thread [<5> HeapWorker] (Suspended (exception IllegalStateException)) 
    SQLiteCursor.finalize() line: 603   
    NativeStart.run() line: not available [native method]   

解决方案

Use managedQuery() function to query the data. If you use managedQuery() instead of query() then Activity will keep the reference of the Cursor and automatically close it when it is not used.

这篇关于如何在code IllegalStateException异常处理上的光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆