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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:37:58+00:00 2026-05-19T23:37:58+00:00

I am calculating creating apps for Online Shopping in which i am having a

  • 0

I am calculating creating apps for Online Shopping in which i am having a Deals Start Date and End Date..

From this two date i want to calculate the time remaining for the Deal to end in Seconds basis.. I calculated remaining days,seconds,hours,minutes..

I want to display the Remaining time in Days:Hours:Minutes:Seconds format…

Although i move to next activity this time should runs in background in which the second must updated every seconds..

If i move this activity again i want to display the Updated Remaining time…

Also in my UI the Remaining time must get reduced second by second.

  • 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-19T23:37:59+00:00Added an answer on May 19, 2026 at 11:37 pm

    Instead of building a service I would create a Handler that updates your Userinterface.
    You can now call sendEmptyMessageDelayed with a delay of 1000ms. In the handleMessage method you can update your UI and call sendEmptyMessageDelayed again.

    Don’t count on Android to call you exactly in time. recalculate the remaining time every now and then instead of just decreasing it by one.

    If the activity is in the background you shouldn’t update the UI because the activity is paused. Just disable the whole updating process in the onPause method and reenable it in your onResume method. If you method is destroyed from the system while it was in the background your onCreate method will be called again and you have to recalculate the actual remaining time.

    Make sure you understand the ActivityLifecycle Process before implementing this changes.

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

Sidebar

Related Questions

I am calculating the number of days between the 'from' and 'to' date. For
I am having trouble calculating time difference. I am getting one time from web
I am creating a calendar. I fill the year and date like this <<<<<
I am creating an iphone application in which some calculations are done for calculating
I am calculating 16 bit checksum on my data which i need to send
I'm creating a library which will add a view at the bottom of the
Does anyone have a decent algorithm for calculating axis minima and maxima? When creating
I am creating line graph using outputs from a thread, the threads are simulations
I am considering creating a RESTful web service which will return a lot of
I'm creating a weekly calendar view, and part of that is calculating the first

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.