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 8703839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:57:21+00:00 2026-06-13T02:57:21+00:00

Even the Log.d is not being called. Can’t find the error. I have looked

  • 0

Even the Log.d is not being called. Can’t find the error. I have looked at Android – SMS Broadcast receiver, Android – Listen For Incoming SMS Messages. I have been looking for the solution for last 24 hours or so. Please see and tell where I am wrong.

No exceptions are thrown. SmsListener is in my package folder, where all other activities are placed.

Update added android:enabled="true" to receiver. Then also not worked.

I have in my manifest:

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

<receiver android:name=".SmsListener" android:exported="false">
     <intent-filter android:priority="2147483647">
         <action android:name="android.provider.Telephony.SMS_RECEIVED" />
     </intent-filter>
</receiver>

SmsListener.Java Code:

public class SmsListener extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {

    Log.d(MainActivity.TAG,
            "in Receiver. intent.getAction():" + intent.getAction());

    if (intent.getAction()
            .equals("android.provider.Telephony.SMS_RECEIVED")) {
        Bundle bundle = intent.getExtras(); // ---get the SMS message passed
                                            // in---
        SmsMessage[] msgs = null;
        String msg_from;
        if (bundle != null) {
            // ---retrieve the SMS message received---
            try {
                Object[] pdus = (Object[]) bundle.get("pdus");
                msgs = new SmsMessage[pdus.length];
                for (int i = 0; i < msgs.length; i++) {
                    msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
                    msg_from = msgs[i].getOriginatingAddress();
                    String msgBody = msgs[i].getMessageBody();
                    NotifyMe(context, msg_from, msgBody);
                }
            } catch (Exception e) {
                // Log.d("Exception caught",e.getMessage());
            }
        }
    }
}
private void NotifyMe(Context context, String msg_from, String msgBody) {
     // do something
}
}
  • 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-13T02:57:23+00:00Added an answer on June 13, 2026 at 2:57 am

    The problem is now solved. Modified receiver in manifest to

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

    It works for me. Hope someone gets benefited by this. Thanks everyone for the help.

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

Sidebar

Related Questions

I'm really confused, and not even sure what to search for to find answers.
I have a method being called by another class that performs a number of
I'm working on an Android application that uses sockets. I have a function called
At even moderate a request volume, the rails log in 3.2.x writes to the
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
I have exhausted my efforts to find any useful information about the IAuthorizeRemotingConnection interface
For an existing java application (which I do not have the source code) I
I am having an odd issue in which the SharedPreferences are not being updated
Can someone tell me why the code from Starting new code onwards does not
I have an issue with a partial View being cached when it shouldn't be.

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.