Unable to resume Activity error

依然范特西╮ 提交于 2019-12-04 01:12:29

I think this is because of the managedQuery call + you closing the cursor. From the docs of the managedQuery() method:

Warning: Do not call close() on a cursor obtained using this method, because the activity will do that for you at the appropriate time. However, if you call stopManagingCursor(Cursor) on a cursor from a managed query, the system will not automatically close the cursor and, in that case, you must call close().

Leave the cursor for the Android system to manage and don't call cursor.close();.

Note: The managedQuery method is deprecated and it should be avoided, implement CursorLoaders instead. More info about CursorLoaders can be found at developer.android.com.

remove cursor.close(); in your code it work fine definitely

Function, managedQuery() is deprecated.

Please use getContentResolver().query().

The parameters is the same.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!