0
請告訴我如何獲取郵件發件人的姓名。我試着跟隨。所有領域工作正常,但名稱始終爲0.請給我解決方案。獲取郵件發件人的姓名
String SORT_ORDER = "date DESC";
int count = 0;
String[] str= new String[] { "_id", "thread_id", "address", "person", "date", "body" };
Cursor cursor = getContentResolver().query(
Uri.parse("content://sms"),
str,
null,
null,
SORT_ORDER);
Log.e("!!!!!!!!", ""+cursor.getCount());
while (cursor.moveToNext()) {
try {
// count = cursor.getCount();
long messageId = cursor.getLong(0);
long threadId = cursor.getLong(1);
String address = cursor.getString(2);
long contactId = cursor.getLong(3);
String contactId_string = String.valueOf(contactId);
long timestamp = cursor.getLong(4);
String body = cursor.getString(5);
Log.e("!!!!!!!!", "number"+address);
Log.e("!!!!!!!!", "name"+contactId_string);
搜索我不能夠使用這些codes.Thanx – william
得到消息發送者的名字郵件發件人的數量,其Android版本你正在使用來測試它? –