I queried "content//sms/" and I don't know what some fields mean. They are -
- Thread ID
- Protocol
- Status
- Reply_Path_Present
- Service_Center
I checked them in LogCat and found the values to be these:
- Thread ID 开发者_如何学Python: 1 to 6 etc..
- Protocol : null / 0
- Status : -1
- Reply_Path_Present : null / 0
- Service_Center : null
Please tell me what the meanings of those values are.
You can use Cursor.getColumnNames()
to retrieve the column names of any content provider, e.g.
ContentResolver contentResolver = getContentResolver();
Cursor cursor = contentResolver.query(
Uri.parse("content://sms/inbox"), null, null, null, null);
String[] columnNames = cursor.getColumnNames();
For content://sms/inbox
this yields _id, thread_id, address, person, date, protocol, read, status, type, reply_path_present, subject, body, service_center, locked on my phone.
You can also have a look at the SmsProvider
but it is not part of the public API.
The folling is the way to determine all the columns that a particular Cursor has .
StringBuffer info = new StringBuffer();
for( int i = 0; i < Cursor.getColumnCount(); i++) {
info.append("Column: " + Cursor.getColumnName(i) + "\n");
}
Print this out to know what are all the columns in the table .
精彩评论