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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:09:13+00:00 2026-05-29T07:09:13+00:00

I need to make an app that will run forever at the background and

  • 0

I need to make an app that will run forever at the background and if needed it opens activity for user UI. I made an Activity that is the main activity which all it does at it’s onCreate is to call to startService(new Intent(this, MainService.class));
The problem is that after the onStart command of the service is being called the MainService class becomes null and it is stops running.

Do I need to start the service in a different way? Should I start a new thread for the service?

Thanks,
Nahum

  • 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-05-29T07:09:14+00:00Added an answer on May 29, 2026 at 7:09 am

    if your want to continue your service running though app gt close.then you need to return STICKY like that. and also need to use BroadcastReciever.and your service will not run continuesly because if system need to release memory then it will kill but yes you can restart your service for sure. So i will suggest you to go through whole documentation and stuff of service Service and
    Broadcast
    it may helpful for you. and one thing there are preferences which process will kill first by system and so on..check it out.

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

Sidebar

Related Questions

We need to make changes to an app that will cause all its URLS
I need to install an application that will run once for any user that
Currently building a WPF app that will run in an environment where the user
I need to make sure that our iPhone App (implemented with Monotouch) will still
I am trying to create a background app which will run at system startup.
I make an app that have to printing image. I need to print image
I need to make a QT app to run on the startup of an
Here's the situation: I have a predetermined GPS route that the user will run.
I need to make rate option in my android app. I found this link
I need to make simple CRUD web app (i'll get paid for it), but

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.