Android 在光标适配器中更改光标
嗨,我有自定义游标适配器,在我的游标中我有int值,它总是1或0,在我的listview中,我有每个listitem的按钮,当我单击它时,我想更改按钮的图像背景并更新数据库。 对于单击按钮侦听器,我在xml中使用onclick,并在活动类中创建方法,在更新数据库后,我使用此代码更改光标Android 在光标适配器中更改光标,android,android-cursoradapter,Android,Android Cursoradapter,嗨,我有自定义游标适配器,在我的游标中我有int值,它总是1或0,在我的listview中,我有每个listitem的按钮,当我单击它时,我想更改按钮的图像背景并更新数据库。 对于单击按钮侦听器,我在xml中使用onclick,并在活动类中创建方法,在更新数据库后,我使用此代码更改光标 startManagingCursor(cursor); adapter.changeCursor(cursor); 但是当我运行我的应用程序时,我收到了这个错误消息 android.database.
startManagingCursor(cursor);
adapter.changeCursor(cursor);
但是当我运行我的应用程序时,我收到了这个错误消息
android.database.StaleDataException: Attempting to access a closed CursorWindow.Most probable cause: cursor is deactivated prior to calling this method.
当然,我看到了很多问题,但我没有得到清楚的答案。
在第一个问题中,我不明白这句话
mIndexer.setCursor(cursor);
什么是mindexer?第二个问题和我的问题无关,除了标题。
谢谢你的帮助