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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:15:40+00:00 2026-06-16T18:15:40+00:00

I want to ask a question. I have make a button that starts and

  • 0

I want to ask a question.
I have make a button that starts and stops a background service.
I make a class SmsReceiver which reads an incoming sms.
So i want when the service is start to call the the Sms BroadcastReceiver.
Any ideas or any other idea how to read an sms with background service?

  • 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-16T18:15:41+00:00Added an answer on June 16, 2026 at 6:15 pm

    If you already have the SmsReceiver working fine,all you need to do is register it from the Service.To do that you need to override the Service‘s onCreate().

    Your Service should look something like this:

    public class SmsService extends Service
    {
      private SmsReceiver receiver; //global so we can unregister it when the time comes.
      public void onCreate ()
      {
        super.onCreate ();//call to super
        //make a new intent filter so that all incoming SMS get to you as well
        IntentFilter smsFilter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
        receiver = new SmsReceiver(); //make a new SmsReceiver
        registerReceiver(receiver, smsFilter); //register the Receiver
      }
    
      public void onDestroy ()
      {
        unregisterReceiver (receiver); //unregisters the Receiver if Service is killed
        super.onDestroy();
      }
    }
    

    In the manifest, be sure to include the necessary SMS permissions and remember to also declare the Service in the manifest.

    <service android:name=".SmsService" >
    </service>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello every one I want to ask a question that what is simple exec
I want to ask a basic question that I couldn't find in online tutorials.
Before I ask my question, I want to mention that I am only today
I want to ask quick question, i want to make a select drop down
First: I'm shocked that I have to ask this question. Nowhere in the docs
Sorry, I want to ask a newbie question :) I have PHP scripts like
I want to make a faq panel when user ask any question it show
This is my first here in Stackoverflow. So I just want to ask question
I want to ask a question about UITableViewCell. Apparently, this is what I want
i want to ask a question about how to do paging in ASP.net coding

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.