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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:40:43+00:00 2026-06-09T12:40:43+00:00

I have an class as below: public class FYPSmsReceiverBroadcast extends BroadcastReceiver I need to

  • 0

I have an class as below:

public class FYPSmsReceiverBroadcast extends BroadcastReceiver

I need to unregister the receiver as I am getting a force close error AFTER I have existed the application when I receive an SMS message. (indicating something is still listening for the sms but not able to access a particular activity because the app has been closed; the error only seems to happen after 1 text received, a second text seems to produce no force close error)

There are a number of somewhat similar questions, but none that can assist the method I have employed. I have tried adding an onPause like below:

 public void onPause() {


        unregisterReceiver(FYPSmsReceiverBroadcast);
    }

But this results in the following error in eclipse: ‘FYPReceiverBroadcast cannot be resolved to a variable’

In the onReceive method of the class that extends Broadcast receiver I have a call to:
FYPSpeakerActivity.speakSMSfrom();

Which calls another class that uses text to speech – This line appears to be the one being called (despite the application being closed) on receipt of an SMS, and creates the force close error.

Can anyone advise?

  • 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-09T12:40:45+00:00Added an answer on June 9, 2026 at 12:40 pm

    FYPReceiverBroadcast is a class. You need to pass an object, here is an example:

    FYPReceiverBroadcast myFYPReceiverBroadcast = new FYPReceiverBroadcast(...);
    
    ...
    
    public void onPause() {
         unregisterReceiver(myFYPReceiverBroadcast);
    }
    

    This is such a fundamental programming concept, I recommend you to read the following article to learn the difference:

    An object is a software bundle of related state and
    behavior. A class is a blueprint or prototype from which objects are
    created.

    http://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/

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

Sidebar

Related Questions

I new to flex, I have a class shown below: public class Items extends
I have a class which extends a JPanel. Code below: public class Test extends
I have class with collection as below public class MyClass:IXmlSerializable { int vesrion; private
I have a class that implements InvocationHandler as below: public class MyProxyClass implements InvocationHandler
Say I have a class with three constructors, like the one below: public class
I have a Student class in my application as below: public class Student {
Say I have a simple address class like below: public class Address { public
I have the code below : public class Anything { public int Data {
Does making the below class final (adding public final class) have any real impact
I have create a Java class extending LinearLayout as shown below public class CustomLinear

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.