Android - SMS BroadcastReceiver Working on Emulator but Not on Phone
<p>I just wanted to know why my simple sms receiver works on my emulator(2.3) but not working on my phone(2.3).</p>

<p>My simple program will show a toast whenever I receive a new SMS.
It is showing on the emulator, and again not on the phone.</p>

<p>I tried two emulator and it works. </p>

<p>Here are the codes.</p>

<pre><code>public class SMSReceiver extends BroadcastReceiver {

 @Override
 public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    System.out.println("A new message just arrived.");
    Toast.makeText(context, "weee", Toast.LENGTH_LONG).show();
 }

}
</code></pre>

<p>Manifest:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.smsreceiver"
android:versionCode="1"
android:versionName="1.0" &gt;

&lt;uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="16" /&gt;

&lt;uses-permission android:name="android.permission.RECEIVE_SMS" /&gt;

&lt;application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" &gt;
    &lt;activity
        android:name="com.example.smsreceiver.MainActivity"
        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 android:name=".SMSReceiver" android:exported="true"&gt;
        &lt;intent-filter&gt;
         &lt;action android:name="android.provider.Telephony.SMS_RECEIVED"/&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;

&lt;/application&gt;

&lt;/manifest&gt;
</code></pre>
