开发者

How to solve database error like database and cursor not close properly

hi all members thanks in advance.

when i run my Database application in logcat show the error like:

database and cursor not close properly

a开发者_JAVA技巧pplication is not crash but sometime it creates a problem in device how can i get rid of this error? it always happen when i run any database application.


Close the cursor if exists after your code execution done (in finally statements)

finally {
        if (cursor != null) {
            cursor.close();
        }
    }

Thanks Deepak


always close the cursor using cursor.close()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜