title: SMS Broadcast Receiver doesn't get the textmessage
body: <p><strong>What I've done</strong></p>
  
  <hr>
  
  <p>Hello Guys, I'm creating at the moment a SMS Broadcast Receiver, i just builded one up with this tutorial: <a href="http://mobiforge.com/developing/story/sms-messaging-android" rel="nofollow">Broadcasttutorial</a>. After I did the code, I updated my Manifest. After that I sent sms from my other Phone to my Phone, but It didn't work. I didn't get any output.</p>
  
  <p><strong>Question</strong></p>
  
  <hr>
  
  <p>What do I need to change, that I can receive those SMS. Please gimme a detailed anwser that I can learn it, a good tutorial would also be great!</p>
  
  <p><strong>Code</strong></p>
  
  <hr>
  
  <p>SMSBroadcastReceiver (is in package .services)</p>
  
  <pre><code>package de.retowaelchli.filterit.services;
  
  import de.retowaelchli.filterit.R;
  import android.app.Notification;
  import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.telephony.SmsMessage;
  import android.util.Log;
  import android.widget.Toast;
  
  
  public class SmileySmsReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) 
      {
          //---get the SMS message passed in---
          Log.d("SmileySmsReceiver", "Yes it calls the onReceive");
          Bundle bundle = intent.getExtras();        
          SmsMessage[] msgs = null;
          String str = "";            
          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]);                
                  str += "SMS from " + msgs[i].getOriginatingAddress();                     
                  str += " :";
                  str += msgs[i].getMessageBody().toString();
                  str += "\n";        
              }
              //---display the new SMS message---
              Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
          }                         
      }
  }
  </code></pre>
  
  <p>This is my AndroidManifest.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="de.retowaelchli.filterit"
        android:versionCode="1"
        android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="10" /&gt;
  
      &lt;!--  User Permission --&gt;
      &lt;uses-permission android:name="android.permission.RECEIVE_SMS"&gt;&lt;/uses-permission&gt;  
  
      &lt;application android:icon="@drawable/icon"
                   android:label="@string/app_name"
                   android:debuggable="true"
                   android:screenOrientation="sensor"
                   android:theme="@style/FilterIt.Theme"&gt; 
  
          &lt;activity android:name=".SplashScreenActivity"
                    android:label="@string/app_name"&gt;
  
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
       &lt;!-- Receiver --&gt;
          &lt;receiver android:name="de.retowaelchli.filterit.services.SmileySmsReceiver" android:enabled="true"&gt; 
              &lt;intent-filter&gt; 
                  &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt; 
              &lt;/intent-filter&gt; 
          &lt;/receiver&gt;     
  
  
  
          &lt;!--  Startseite --&gt;
          &lt;activity android:name=".StartseiteActivity"&gt;&lt;/activity&gt;
  
          &lt;!-- Von Startseite ausgehende Activitys --&gt;   
          &lt;activity android:name=".SmileyActivity"&gt;&lt;/activity&gt;
          &lt;activity android:name=".ADeleteActivity"&gt;&lt;/activity&gt;
          &lt;activity android:name=".StatsActivity"&gt;&lt;/activity&gt;
          &lt;activity android:name=".HelpMenuActivity"&gt;&lt;/activity&gt;
  
  
          &lt;!-- Von Stats ausgehende Activitys --&gt;
          &lt;activity android:name=".stats.ADFilterStats"&gt;&lt;/activity&gt;
          &lt;activity android:name=".stats.SFilterStats"&gt;&lt;/activity&gt;
          &lt;activity android:name=".stats.CreatedADFilters"&gt;&lt;/activity&gt;
          &lt;activity android:name=".stats.CreatedSFilters"&gt;&lt;/activity&gt;
  
          &lt;!-- Von ADeleteActivity ausgehende Activitys --&gt;
          &lt;activity android:name=".ADFilterConfigActivity"&gt;&lt;/activity&gt;
  
          &lt;!--  Von SmileyActivity ausgehende Activitys --&gt;
          &lt;activity android:name=".SFilterConfigActivity"&gt;&lt;/activity&gt;
  
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>