I have a problem in finding out the receiver phone number from the incoming raw SMS. Here is the code that I am trying:
Can someone tell me how to retrieve receiver phonenumber from raw SMS.
public class SMSReceiver extends BroadcastReceiver {
private Context context;
@Override
public void onReceive(Context context, Intent intent) {
    this.context = context;
    // Parse the SMS.
    Bundle bundle = intent.getExtras();
    SmsMessage[] msgs = null;
    String str = "";
    if (bundle != null)
    {
        // Retrieve the SMS.
        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]);
            //appending to str String.
             str += "OriginatingAddress: ";
            str += msgs[i].getOriginatingAddress();
            str += " :\n";
            str += " :\n";
            str += "DisplayOriginatingAddress: ";
            str += msgs[i].getDisplayOriginatingAddress();
            str += " :\n";
            str += " :\n";
            str += "DisplayMessageBody: ";
            str += msgs[i].getDisplayMessageBody();
            str += " :\n";
            str += " :\n";
            str += "MessageBody: ";
            str += msgs[i].getMessageBody();
        }
        Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
    }
}
Thanks for help in advance!