比如说我想提取15555215556这个号码中的短信内容该怎么做啊

解决方案 »

  1.   

    ContentResolver cr = getContentResolver(); 
    Uri uri = Uri.parse("content://sms/");   
    String[] projection = new String[]{"address","body"};
    Cursor cur = cr.query(uri, projection, null, null, null); 
    if(cur!=null && cur.getCount()>0){
    cur.moveToFirst();
    do{

       String phoneNumber = cur.getString(cur.getColumnIndex("address"));
       if(phoneNumber.equals("15555215556")){
        Log.e("短信内容:",cur.getString(cur.getColumnIndex("body")));
       }
    }while(cur.moveToNext());
    }