Answer the question
In order to leave comments, you need to log in
how to make a clock on android
While not strong in programming, please tell me how to make a clock so that it goes?
Tried Date and through SimpleDateFormat displayed on TextView. But how to make them update themselves? It is impossible to cram into the cycle, the Application does not start .. Who knows how to do this, tell me please .. And they will need to be run in a separate thread, do I understand correctly?
Answer the question
In order to leave comments, you need to log in
There are many options. It is possible through Handler
private Handler TimeHandler = new Handler() {
@Override
public void handleMessage(Message message) {
//Обновляем часы
TimeHandler.sendEmptyMessageDelayed(0,1000L);//1 sec update
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question