1.通过电话号码得到这个电话号码的所有短信uri

Uri uri = null;

                String selection = new String("address=" + mobile);// key就是你要查的号码
                Cursor cursorCantacts = Activity_FriendList.this.getContentResolver().query(
                        Uri.parse("content://sms"), null, selection, null, null);

                /*
                 * Cursor cursorCantacts =
                 * Activity_FriendList.this.getContentResolver().query(
                 * uriNumber2Contacts, null, null, null, null)
                 */;
                if (cursorCantacts.getCount() > 0) { // 若游标不为0则说明有头像,游标指向第一条记录
                    cursorCantacts.moveToFirst();
                    Long thread_id = cursorCantacts.getLong(cursorCantacts
                            .getColumnIndex("thread_id"));
                    String SMS_AUTHORITY = "sms";
                    Uri SMS_CONTENT_URI = Uri.parse("content://" + SMS_AUTHORITY);
                    uri = ContentUris.withAppendedId(SMS_CONTENT_URI, thread_id);
                }

2. 通过电话号码得到这个用户的电话URI

Uri uri = null;
                Uri uriNumber2Contacts = Uri
                        .parse("content://com.android.contacts/"
                                + "data/phones/filter/" + mobile);
                Cursor cursorCantacts =getContentResolver().query(uriNumber2Contacts, null,
                                null, null, null);
                if (cursorCantacts.getCount() > 0) { // 若游标不为0则说明有头像,游标指向第一条记录
                    cursorCantacts.moveToFirst();
                    Long contactID = cursorCantacts.getLong(cursorCantacts
                            .getColumnIndex("contact_id"));
                     uri = ContentUris.withAppendedId(
                            ContactsContract.Contacts.CONTENT_URI, contactID);
                }

                final Intent i = new Intent(Activity_FriendList.this,
                        MessageListActivity.class);
                i.setData(uri);