Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
570 views
in Technique[技术] by (71.8m points)

android - getContentResolver query cause CursorWrapperInner warning

On 4.0.3, Code below cause warning "W/CursorWrapperInner(11252): Cursor finalized without prior close()".

    Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
    getContentResolver().query(uri, null, null, null, null);

In sorce, I found the warning where it come from, anyone tell me how to avoid as i doubt it related to some weird problem?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have also experienced this weird issue. I'm using a ContentProvider to provide me with a Cursor and a CursorLoader to handle the fetching in my Fragment/Activities. So I'm doing everything "to the book".

I experienced this warning message using a 4.1.1 device, but it seems to have gone away on my Nexus 7 which is 4.2. Personally I would not take any serious notice of this warning.

Update: I was testing my code with Android v2.2 and I got a full stacktrace from this error. It turned out that my code was fetching another Cursor (not the one fetched using a Loader) and it was this that was the offending code. Closing this manually did the trick.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...