android错误 : Channel is unrecoverably broken and will be disposed!

Uri uri = Uri.parse("content://com.android.contacts/data");
Cursor cursor = getApplicationContext().getContentResolver().query(uri, new String[]{"_id",}, null, null, null);
assert cursor != null;

 

代码部分代码如上:

然后出现   Channel is unrecoverably broken and will be disposed! 错误

原因是:cursor使用后没有关闭;

添加一行关闭代码即可:

cursor.close();

欢迎进(Q)群,帮你解决问题:

android错误 : Channel is unrecoverably broken and will be disposed!_第1张图片

 

你可能感兴趣的:(android,android错误)