public class SMSReceiver extends BroadcastReceiver { 
     /** TAG used for Debug-Logging */ 
     protected static final String LOG_TAG = "SMSReceiver"; 
     /** The Action fired by the Android-System when a SMS was received. 
      * We are using the Default Package-Visibility */ 
     private static final String ACTION = "android.provider.Telephony.SMS_RECEIVED"; 
    
 // @Override 
    public void onReceive(Context context, Intent intent) { 
          
     Log.i(LOG_TAG, "[inside onReceive] "); 
      
     if (intent.getAction().equals(ACTION)) { 
              
           StringBuilder sb = new StringBuilder(); 
             Bundle bundle = intent.getExtras(); 
              
             if (bundle != null) { 
                 Object[] pdusObj = (Object[]) bundle.get("pdus"); 
                 SmsMessage[] messages = new SmsMessage[pdusObj.length]; 
                 for (int i = 0; i<pdusObj.length; i++) { 
                         messages[i] = SmsMessage.createFromPdu ((byte[]) pdusObj[i]);
                         
                         Log.i("aaaaaaa", messages[i].getOriginatingAddress() 
                                 + "::" + messages[i].getMessageBody()); 
                 } 
              
                 Log.i(LOG_TAG, "[SMSApp Bundle] " + bundle.toString()); 


          String m = messages.toString();
               
          if(m.equals("Where are you?"))
          {
           Toast.makeText(context, "맞았음+_+", Toast.LENGTH_SHORT).show();
          }
          else
          {
           Toast.makeText(context, "틀렸음ㅠ_ㅠ", Toast.LENGTH_SHORT).show();
          }
       

 // Consume this intent, that no other application will notice it. 
              this.abortBroadcast(); 
              
              // Start the Main-Activity 
              Intent i = new Intent(context, SMSActivity.class); 
             // i.setLaunchFlags(Intent.NEW_TASK_LAUNCH); 
              i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
              context.startActivity(i); 
              
         } 
    } 
}
}


어떤분 블로그에서 수신된 문자를 가져와서 토스트로 보여주는 소스를 발견했는데요
거기다가 제가 그 받은 문자랑 제가 지정해놓은 문자랑 비교해서
맞으면 맞다고 토스트를 띄워주려고 하는데
자꾸 "틀렸음ㅠ_ㅠ" 이렇게만 나옵니다....

아무래도 String m 에 메세지가 들어가지 않는거 같은데
자바 초보라서 어떻게 값을 받아와야 할지 잘 모르겠어요.. 도와주세요ㅠ.ㅠ