When I try to query the CallLog data from android phone, I got the following error. android.database.sqlite.SQLiteException: no such column: data_id (code 1): , while compiling: SELECT CallsStat_id, ip_prefix, numberlabel, matched_number, type, date, contactid, statNew, lookup_uri, moduletype, _id, name, normalized_number, ring_count, photo_id, formatted_number, number, geocoded_location, countryiso, data_id, numbertype, new, duration, simid, isprivate, voicemail_uri, is_read, raw_contact_id, vtcall FROM calls_restrict_view ORDER BY duration DESC. But, the query work correctly some android phone. Here is my code.Cursor managedCursor = activity.getContentResolver().query(CallLog.Calls.CONTENT_URI, null, null, null,CallLog.Calls.DURATION + " " + sorting);
Asked
Active
Viewed 1,066 times
0

Thiha Zaw
- 806
- 1
- 9
- 25
-
Have you tried pulling the database base out of the device/emulator to make sure all the columns are there? – Kristy Welsh Sep 24 '14 at 17:33
-
I'm just a beginner in android. So, please let me know how to pulling the database out of the device/emulator. Thank you Kristy Welsh. – Thiha Zaw Sep 25 '14 at 04:38
-
Are you using Eclipse or Android Studio? – Kristy Welsh Sep 25 '14 at 21:44
-
I'm using Android Studio. – Thiha Zaw Sep 26 '14 at 05:07
-
Try this to pull out the database: http://stackoverflow.com/questions/17529766/see-database-filecontent-via-android-studio – Kristy Welsh Sep 26 '14 at 14:57