1
我正在尋找改變我的背景顏色一秒後按下按鈕來確認是否點擊了正確的按鈕。後綴,我想將顏色切換回黑色,但是當我使用Thread.sleep()時,它不會在線程休眠之前或之後更改顏色。還有其他建議嗎?android背景顏色變化
background.setBackgroundColor(Color.GREEN);
thread.sleep(1000);
background.setBackgroundColor(Color.BLACK);
什麼是背景名稱? –
使用CountDownTimer執行此任務。 http://developer.android.com/reference/android/os/CountDownTimer.html – MyWay
爲什麼不只是使用background.postDelayed()? – aelimill