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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:17:37+00:00 2026-06-09T21:17:37+00:00

I have a custom Chronometer which extends TextView and works as a stopwatch. The

  • 0

I have a custom Chronometer which extends TextView and works as a stopwatch. The Activity that uses this Chronometer is listening for broadcasts from a Service. In this broadcast the Service tells the Activity (and thus the Chronometer) to stop counting. This works fine when keeping the application on foreground.

However, when the Activity is not active (like the user presses the home button), the Activity doesn’t get the broadcast, and the Chronometer keeps counting. So when I open the Activity again, the Chronometer is still counting up, when it shouldn’t be.

Who can provide me with a solution for this?

Note: the Service does not have any knowledge of the Activity nor the Chronometer. It just sends a broadcast “Hey, I’m done with whatever I was doing!”.

  • 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-09T21:17:39+00:00Added an answer on June 9, 2026 at 9:17 pm

    Your service should be called with startForeground(int id, Notification notification);

    See why…

    By the way, your BroadcastReceiver shouldn’t be unregistered within your activity. Add it to the manifest with a intent filter COUNTDOWN_STOP or whatever, to achieve this.

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

Sidebar

Related Questions

I have custom drupal module. I receive result from a webservice that I need
I have custom SiteMapProvider and RoleProvider that works together properly: IsAccessibleToUser returns false if
I have custom exceptions in my django project that look like this: class CustomFooError(Exception):
I have custom assembly that is loaded on runtime. at this point i have
I have been trying to figure out how to make a custom chronometer that
I have custom class that extends WebViewPage that I use as the base for
I have custom db class which extends MySQLi class MySQLi->query() method returns obejct with
I have custom Rythm template tag (sayHi.html) which I want to call from parent
I have custom UITableViewCell . It contains UITextLabel . When I press this cell
I have custom validation rule: public function customRule($check) { } Inside this rule I

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.