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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:22:26+00:00 2026-06-18T11:22:26+00:00

I have a long running service. When the device goes idle and CPU sleeps

  • 0

I have a long running service. When the device goes idle and CPU sleeps the service gets paused. However when I declare a static (in manifest) BroadcastReceiver the phone will execute the onReceive() method even when asleep.

I would like to know how to wakeup my Service and pass some information to it from the BroadcastReceiver. Im completely new to Android development so don’t know anything about the IPC in Android.

I read about bound services but I think this is not my case as I need to service to run in the background.

  • 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-18T11:22:28+00:00Added an answer on June 18, 2026 at 11:22 am

    From your BroadcastReceiver do the following to start MyService:

    public void onReceive(Context context, Intent intent) {
    ...
    Intent svc = new Intent(context, MyService.class);
    svc.setAction("some_action");
    context.startService(svc);
    

    Replace:

    • MyService: with the actual service class name
    • “some_action”: with some action to be passed to the service (a
      String)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long running server side process (gets data via a web service
I too have a long running service using plugins and appdomains and am having
I have a long-running service with several threads calling the following method hundreds of
I have a long running Service method (doing business logic) and I would like
I have an activity that starts a long-running service which in turn adds an
I have a Windows service which performs a fairly long running task. At the
I have a windows service which spawns off long-running tasks while polling for them.
I have a transactional grails service which is doing some (long running) processing. While
I have a long running service which responds to multiple BroadcastReceivers (created in code,
I have a long running process that is called via a Nancy Module Get

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.