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

  • Home
  • SEARCH
  • 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 8719277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:45:18+00:00 2026-06-13T06:45:18+00:00

I am developing an android application that receives SMS messages and uses this data

  • 0

I am developing an android application that receives SMS messages and uses this data inside the application. Because I want the SMS messages’ BroadCastreceiver to close when I close the application, I have placed it inside the main activity:

public class App extends Activity {
 public class SmsReceiver extends BroadcastReceiver {
  ...
 }
 ...
}

It is added in the manifest:

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

The activity runs fine, until I receive an SMS message. I then get the following error:

10-23 15:01:50.019: E/AndroidRuntime(10161): java.lang.RuntimeException: Unable to instantiate receiver be.allys.msgwall.app.App.SmsReceiver: java.lang.ClassNotFoundException: be.allys.msgwall.app.App.SmsReceiver in loader dalvik.system.PathClassLoader[/data/app/be.allys.msgwall.app-1.apk]

Is this because the receiver class is inside another class? That would seem like a possible cause to me, if it weren’t for the fact that another post on StackOverflow advised me to do it this way.

If that’s not the reason, then what is? Any help would be greatly appreciated.

  • 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-13T06:45:20+00:00Added an answer on June 13, 2026 at 6:45 am

    When you register a receiver which is an inter class in the manifest,you should declare the receiver name like this OuterClass$interClass in the manifest.

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

    EDIT 1: You should register the receiver dynamically, so you need have two methods like below code snippet, then you can call registerSMSReceiver in the onResume of Activity and call unRegisterSMSReceiver in the onPause. This will fix your problem.

    private void registerSMSReceiver()
    {
        IntentFilter filter = new IntentFilter();
        filter.addAction("android.provider.Telephony.SMS_RECEIVED");
        registerReceiver(receiver, filter);
    }
    
    private void unRegisterSMSReceiver()
    {
        unregisterReceiver(receiver);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an android application that receives data about events from a server.
I'm developing an android application and I want to recognise links that are inside
I am currently developing an application that receives GPS data gathered using and android
Im developing an application in Android that receives real-time data (via BT) and needs
I'm developing an Android 2.3.3 application with a service. I have this inside that
I'm currently developing an android application that uses sockets to connect to a local
I'm developing an Android 3.1 application that uses USB Host mode to communicate with
Hi an developing drawing android application. in that i want to add a sticker(image)
I am developing an Android application that uses OpenGL to render a 3D ball
I new in the android developing. I want to develop simple application that will

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.