Vote count:
0
I'm getting a SQLiteException
when I attempt to query the SMS/MMS "threads" table from an activity:
void getConversations() {
String[] columns = new String[] {
Telephony.ThreadsColumns.RECIPIENT_IDS,
Telephony.ThreadsColumns.SNIPPET,
Telephony.ThreadsColumns.SNIPPET_CHARSET
};
Cursor cursor = getContentResolver().query(
Telephony.Threads.CONTENT_URI,
columns, null, null, null);
}
The exception's error indicates that no such column exists. If I specify null
instead of columns
(to select all columns) the query succeeds. As you would expect (based on the error), none of the columns returned match the constants in Telephony.ThreadsColumns
. Some of the columns I see are: error_code
, text_only
, ct_t
, msg_box
, etc.
I suspect I'm using the API incorrectly, however the docs for Telephony.Threads
say:
Helper functions for the "threads" table used by MMS and SMS.
and the docs for Telephony.ThreadsColumns
say
Columns for the "threads" table used by MMS and SMS.
Any idea what I'm doing wrong?
asked 1 min ago
Aucun commentaire:
Enregistrer un commentaire