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版本你正在使用来测试它? –