阅读背景:

如何在Android中“等待”一个线程

来源:互联网 
private void startGameTimeElapseThread(){
    new Thread(new Runnable() {
        Date d = new Date();
        public void run() {
            while (gameOn){
                Log.d(TAG,""+d.getTime()+" "+gameStatus.getLastTimeUpdated());

                postInvalidate(795, 150, 1024, 300);
                try {
                    synchronized (this) {
                        wait(1000); 
                    }
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    Log.d(TAG, "Waiting didnt work!!");
                    e.printStackTrace();
                }
            }
        }
    }).start();
}
private void startGameTimeElapseThread(){
    n



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: