可能重复:
如何访问 Android 上的 SMS 存储?
我正在尝试访问 android 中的所有消息。我有代码,但我只通过此代码访问了最后一条消息。怎么能读完?
public void onReceive(Context context, Intent intent) 
{
    //---get the SMS message passed in---
    Bundle bundle = intent.getExtras();        
    SmsMessage[] msgs = null;           
    if (bundle != null)
    {
        String header = "";
        String body = "";
        //---retrieve the SMS message received---
        Object[] pdus = (Object[]) bundle.get("pdus");
        msgs = new SmsMessage[pdus.length];            
        for (int i=0; i<msgs.length; i++)
        {
            msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                
            header = msgs[i].getOriginatingAddress();                     
            body = msgs[i].getMessageBody().toString();       
        }
        //---display the new SMS message---
        Toast.makeText(context,"Mesaj geldi", Toast.LENGTH_SHORT).show();
        Header.add(header);
        Body.add(body);  
    }