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);
Current Time:
User Input:
I hope it will help you…:)