How to “wait” a Thread in Android

前端 未结 5 1782
夕颜
夕颜 2020-12-30 18:18
private void startGameTimeElapseThread(){
    new Thread(new Runnable() {
        Date d = new Date();
        public void run() {
            while (gameOn){
               


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 19:01

    You can try this one it is short :)

    SystemClock.sleep(7000);
    

    It will sleep for 7 sec look at documentation

提交回复
热议问题