java - Android call log query giving illegalargumentexception: column '_id' does not exist -



java - Android call log query giving illegalargumentexception: column '_id' does not exist -

i'm trying list of user's calls , i'm getting illegalargumentexception: column '_id' not exist.

this find weird because did not create or have phone call log table, i'm trying query it. here's code:

string[] strfields = { android.provider.calllog.calls.number, android.provider.calllog.calls.type, android.provider.calllog.calls.date, android.provider.calllog.calls.duration }; string strorder = android.provider.calllog.calls.date + " desc"; callcursor = getcontentresolver().query( android.provider.calllog.calls.content_uri, strfields, null, null, strorder ); // desired columns bound string[] columns = new string[] { android.provider.calllog.calls.date, android.provider.calllog.calls.duration, android.provider.calllog.calls.type, android.provider.calllog.calls.number };

... , listview/cursor adapter stuff.

so there i'm doing wrong here in query? there alternate solutions accessing phone call log?

thanks.

if you're using cursoradapter callcursor must include column named "_id", otherwise adapter not work (cursoradapter)

you should add together string strfields array

android.provider.calllog.calls._id

then cursoradapter should work expected

java android calllog

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -