Is it possible to compare my received msg with resource in xml or textview and edittext
<p>I can start another activity when i receive a sms. what I want to know is <strong>how to compare the text message with the content in my resources(xml string) and also the textview, editText</strong>. <strong>Is it possible to get reference from textview and edittext value in broadcast receiver class?</strong> Below is the code starting an activity without comparing any value. </p>

<p>public class SMSReceiver extends BroadcastReceiver
{</p>

<pre><code>@Override
public void onReceive(Context context, Intent intent) 
{       
    //---get the SMS message passed in---
    Bundle bundle = intent.getExtras();        
    SmsMessage[] msgs = null;
    String str = "";     
    String phonenumber = "";

    if (bundle != null)
    {
        //---retrieve the SMS message received---
        Object[] pdus = (Object[]) bundle.get("pdus");
        msgs = new SmsMessage[pdus.length];

        for (int i=0; i&lt;msgs.length; i++){
            msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                
            phonenumber=msgs[i].getOriginatingAddress(); 
            str += msgs[i].getMessageBody().toString();
            str += "\n";        
        }

        //=======launch the ShowMap1 when recieve SMS==============//
        Intent mainActivityIntent = new Intent(context, ShowMap2.class);
        mainActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        mainActivityIntent.putExtra("phn", phonenumber);
        mainActivityIntent.putExtra("sms", str);

        context.startActivity(mainActivityIntent);  
        //========================END=============================//  

    }                         
}
</code></pre>

<p>}</p>
