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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:17:58+00:00 2026-06-17T20:17:58+00:00

Basically, I have a count down timer right? And I need to display the

  • 0

Basically, I have a count down timer right? And I need to display the time left for the timer in text. I have done that, but the timer’s time is a bit off, as it needs to convert the seconds left into hours and minutes, like on a regular digital watch where it says 00:05:00 and it counts down to 00:04:59. I’ve done a lot of things today and my head is hurting quite a bit at the moment, so I can’t exactly think about it. So my guess is that I need to use multiples of 60. Help?

Code:

int timeinminutes=1;

    new CountDownTimer(timeinminutes*100000, 1000) {

        TextView mTextField = (TextView) findViewById(R.id.textView1);

         public void onTick(long millisUntilFinished) {
             long hrs=0;
             long mnts=0;
             long scnds=0;
             scnds=(millisUntilFinished/1000);
             if (scnds>59) {
                 mnts=(scnds/60);
                 if (mnts!=Math.floor(mnts)) {
                     mnts=0;
                 }

             }
             if (mnts>59) {
                 hrs=(mnts/60);
                 if (hrs!=Math.floor(hrs)) {
                     hrs=0;
                 }
             }
             mTextField.setText(hrs + ":" + mnts + ":" + scnds);
         }

         public void onFinish() {
             mTextField.setText("00:00:00");
         }
      }.start();
  • 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-17T20:17:59+00:00Added an answer on June 17, 2026 at 8:17 pm

    A lot of this has already been done. If you read about SimpleDateFormat it should help you get on your way to solving this.

    You can find more information here as well.

    Check out java.util.Timer here.

    These should solve any of your problems.

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

Sidebar

Related Questions

Interesting problem! Basically I have a timer for my UI that counts down from
I have a timer class set up that is basically handling all of count
I basically have 7 select statements that I need to have the results output
I have a control that is basically functioning as a client-side timer countdown control.
How can I do a count distinct selection? Basically I have all these charges
I basically have a program that filters records from one excel file to another
Basically i have a query string that when i hardcode in the catalogue value
Basically my aim is to have this timer reset whenever the user presses button
So this is basically a reassurance that I'm doing the whole registration/login process right
So, we have a table that basically includes most of the ticket details of

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.