BroadcastReceiver with SmsMessage
<p>Application is being developed in 2.3.3. 
I am testing the application in Emulators..</p>

<p>Task ::: Whenever a new message arrives, I have to display the sender and the text of the message in a Toast.</p>

<p>Problem ::: Toast doesn't get displayed.</p>

<p>My Code File :::</p>

<pre><code>package com.callee.helper;


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.widget.Toast;


public class CalleeHelperActivity extends BroadcastReceiver {

    @Override
    public void onReceive(Context arg0, Intent receivedIntent) {
        // TODO Auto-generated method stub


        Bundle b = receivedIntent.getExtras();
        SmsMessage[] msgs = null;
        String str ="";

        if(b!=null)
        {
            Object[] pdus = (Object[])b.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";
            }

            Toast.makeText(arg0, str, 50).show();

        }
        else{
        Toast.makeText(arg0, "There is a problem", 50).show();
        }
    }
}
</code></pre>

<p>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="com.callee.helper"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk android:minSdkVersion="10" /&gt;
    &lt;uses-permission android:name="android.permission.READ_SMS"/&gt;
    &lt;uses-permission android:name="android.permission.SEND_SMS"/&gt;

    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" &gt;

        &lt;receiver android:name=".CalleeHelperActivity"&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>

<p>I cannot trace where the problem is. Can someone please help me...</p>

<p>I tried to set a break point in onReceive(), but it doesn't hit. What could be the problem?</p>
