如何避免在Android的这条消息 [英] How to avoid this message in Android

查看:68
本文介绍了如何避免在Android的这条消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的android下面的错误消息。

定稿尚未停用或关闭游标。数据库= /data/data/com.example.Recipie/databases/recipedbase.db,表=食谱,查询= SELECT DISTINCT标题从食谱WHERE标题=迈索尔霸 android.database.sqlite.DatabaseObjectNotClosedException:应用程序没有关闭在这里打开的游标或数据库对象 在android.database.sqlite.SQLiteCursor(SQLiteCursor.java:210)

我在code补充这一点。而且我得到了上述消息。请帮助。 :)

  @覆盖
    保护无效的onDestroy()
    {
        super.onDestroy();
        rDbHelper.close();
    }
 

解决方案

您必须关闭游标。

I get the below error message in android.

Finalizing a Cursor that has not been deactivated or closed. database = /data/data/com.example.Recipie/databases/recipedbase.db, table = recipes, query = SELECT DISTINCT title FROM recipes WHERE title="Mysore Pa" android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here at android.database.sqlite.SQLiteCursor.(SQLiteCursor.java:210)

I have added this in my code. But Also i get the above message. Kindly help. :)

@Override
    protected void onDestroy()
    {
        super.onDestroy();
        rDbHelper.close();
    }

解决方案

You must close your cursors.

这篇关于如何避免在Android的这条消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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