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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:46:25+00:00 2026-06-09T11:46:25+00:00

When i run the program, the system current time is show in a textview.

  • 0

When i run the program, the system current time is show in a textview.
Now i have a button, an edittext, and a textview.
I want When i put 40 on the edittext, i count this by the current hour second, and you display it by pushing the botton on a textview.
I just want to count the current hour second when i get it from edittext.
As you know when the current hour second is counted by a number, it will effect on the minute and hour too

help me please
this code show current time :

    Thread myThread = null;
    Runnable runnable = new CountDownRunner();
    myThread= new Thread(runnable);   
    myThread.start();
}
public void doWork() {
    runOnUiThread(new Runnable() {
        public void run() {
            try{    
               txtCurrentTime= (TextView)findViewById(R.id.lbltime);
                    Date dt = new Date();
                    int hours = dt.getHours();
                    int minutes = dt.getMinutes();
                    int seconds = dt.getSeconds();
                    String curTime = hours + ":" + minutes + ":" + seconds;
                    txtCurrentTime.setText(curTime);
  • 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-09T11:46:27+00:00Added an answer on June 9, 2026 at 11:46 am

    Current Time:

                    txtCurrentTime= (TextView)findViewById(R.id.txtcurrunt);
                    Date dt = new Date();
                    int hours = dt.getHours();
                    int minutes = dt.getMinutes();
                    int seconds = dt.getSeconds();
                    String curTime = hours + ":" + minutes + ":" + seconds;
                    txtCurrentTime.setText(curTime);
    

    User Input:

                    userInput=(EditText)findViewById(R.id.userInputInSeconds);
                    String userInput=userInput.getText().toString();
                    long increment=Long.parseLong(userInput);
    //New Time
                  Date dt = new Date();
                  long newTime =dt.getTime()+(increment)/1000;
                  Date newData=new Date(newTime);
                  int hours = newData.getHours();
                  int minutes = newData.getMinutes();
                  int seconds = newData.getSeconds();
                  String newTimeString = hours + ":" + minutes + ":" + seconds;
    
                  txtNewTime= (TextView)findViewById(R.id.txtNew);
                  txtNewTime.setText(newTimeString);
    

    I hope it will help you…:)

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

Sidebar

Related Questions

I have a working Python based program that I want to run as a
I have a program that I run and in the middle I get this
I want to design a c# program which can run program a 3rd exe
To run a program with custom env settings, we do this on Linux $
I can run my program outside of a jar file, but I want to
Typically when you run any program, during execution time what are different storages available
Have a look at this pseudocode: string exe_path = system.get_exe_path() print This executable is
I keep getting this error when I run the program. Object reference not set
When trying to run the following program code, this error occurred; Input string was
I want to run the Visual Studio debugger on a .Net program that has

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.