-3

I want to show the current time in updatable textView I can't find the true way to make it I want it to be updated every minute Please anyone can help me ? Thanks

Muaz Kadan
  • 18
  • 1
  • 7

3 Answers3

0
Calendar cal = Calendar.getInstance();
SimpleDateFormat oSimpleDateFormat = new SimpleDateFormat("HH:mm:ss");
String MyString= oSimpleDateFormat.format(cal.getTime()); 
EditText oEditText =(EditText) findViewById(R.id.MyEdit);
oEditText.setText(MyString);

try this

0

You should use ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)

http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html

Ufkoku
  • 2,384
  • 20
  • 44
0

use the digital clock tag Digital Clock built in android studio 2.1. Here it is built in tag to show time < Digital Clock > don't use space b/w digital and clock, it was having problem while posting the answer.

Ali Imran
  • 1
  • 1
  • 3