2011-04-06 4 views
1

내 응용 프로그램에서 아래의 코드를 통해 모든 MMS를 가져올 수 있지만 mms 주소를 가져올 수 없습니다. 너 얘들 아 나 ​​좀 도와 줄래?은 mms 주소 번호를 검색합니다

Cursor cursor = activity.getContentResolver().query(Uri.parse("content://mms"),null,null,null,date DESC); 
    count = cursor.getCount(); 
    if (count > 0) { 
     cursor.moveToFirst(); 
     long messageId = cursor.getLong(0); 
     long threadId = cursor.getLong(1); 
     long timestamp = cursor.getLong(2); 
     String subject = cursor.getString(3); 
    } 

답변

3

MMS에서 주소를 얻으려면. 이 같은 것을하십시오

msgnumber는 messageID를 전달합니다.

String add=""; 
final String[] projection = new String[] { "address", "contact_id", "charset", "type" }; 
final String selection = "type=137"; // "type="+ PduHeaders.FROM, 

Uri.Builder builder = Uri.parse("content://mms").buildUpon(); 
builder.appendPath(String.valueOf(msgnumber)).appendPath("addr"); 

Cursor cursor = context.getContentResolver().query(
    builder.build(), 
    projection, 
    selection, 
    null, null); 

    if (cursor.moveToFirst()) { 
     add = cursor.getString(0); 
    } 

희망이 도움이 될 것입니다.

+0

오른쪽. 나는 주소를 얻을 수있다 .. – pakuti

관련 문제