Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8905569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:25:43+00:00 2026-06-15T02:25:43+00:00

Application is being developed in 2.3.3. I am testing the application in Emulators.. Task

  • 0

Application is being developed in 2.3.3.
I am testing the application in Emulators..

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

Problem ::: Toast doesn’t get displayed.

My Code File :::

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<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();
        }
    }
}

My AndroidManifest.XML

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.callee.helper"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="android.permission.READ_SMS"/>
    <uses-permission android:name="android.permission.SEND_SMS"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

        <receiver android:name=".CalleeHelperActivity">
            <intent-filter >
                <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
            </intent-filter>
        </receiver>   

    </application>

</manifest>

I cannot trace where the problem is. Can someone please help me…

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:25:45+00:00Added an answer on June 15, 2026 at 2:25 am

    You need RECEIVE_SMS permission to monitor incoming messages. So, add

    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    

    to your manifest, and you should be good to go 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a flex application being developed in Spanish, and I'd like to build
I have a web application project being developed in VS2010 targetting Framework 4.0. I
I'm currently working on a new web application and it's being developed using Oracle
I have a web application currently being developed in JSP/Servlets. The application allows users
My application is being developed in silverlight. Plan to launch it later this year.
I'm trying to practise deploying a django application that is being developed. i've updated
I a web application that I am developing (being developed in PHP) when a
I have my java-written application being killed after some time of work. Java application
I have a smart client application being deployed with a CickOnce webpage. here's the
How do I prevent my device administration application from being installed? I have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.