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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:02:45+00:00 2026-05-25T18:02:45+00:00

So, originally, I was pushing intents that needed to be sent across my application

  • 0

So, originally, I was pushing intents that needed to be sent across my application at regular intervals using a Service and a TimerTask. After reading the article at http://developer.android.com/resources/articles/timed-ui-updates.html it seemed that this would be the better approach. So, now, my Service creates a handler and sends it on its way. As in the article, my Handler postDelayed()’s itself, making it effectively run indefinitely (until the widget is removed, in which case I clear the handler, thus terminating execution).

My issue is, I know that Services can be eaten by Android for memory in the event that the user needs it. My Handler is a member variable of my Service. Say, for instance, Android eats my service, and then restarts it later on. That, as far as I understand, is a new instance of my Service, and so a new Handler will be instantiated and sent on its way. Aren’t there now two handlers running? Or does the old handler get garbage collected (I’d think not because it has to be referenced somewhere else if it’s still active)? Or does the first handler somehow get shut down automatically? I don’t want 8 of these things running at the same time.

  • 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-25T18:02:46+00:00Added an answer on May 25, 2026 at 6:02 pm

    Handler is part of the Thread and Thread is part of Process. When OS kills a Serivce it purges the whole process.

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

Sidebar

Related Questions

I'm experimenting with Application.AddMessageFilter , using some code written originally by Somebody Else, so
Originally I had a design problem where I needed five subclasses of a superclass,
Originally, I just want to verify that session_start locks on session. So, I create
I originally started this question in another thread, but that thread was sorta, kinda
I originally setup some conditions using CGRectIntersectsRect for some collision detection which worked fine.
I originally created a process that occurred by transitioning between views in a multiview
I originally have an array that reads $array1 = array(a,a,b,b) I run it through
Originally I had my css .less file named Site.less.css so that intelligent type is
How can I tell mercurial that a remote server (originally on bitbucket for example,
I have a very narrow column and a three-word URL that is pushing wider

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.