嗨我在我的应用程序中有一个小倒数计时器,每秒显示另一个Drawable。
public void onTick(long millisUntilFinished) {
if(millisUntilFinished <= 4000 && millisUntilFinished >= 3001 )
{
cdImage.setBackgroundResource(R.drawable.player1_countdown_3);
cdImage2.setBackgroundResource(R.drawable.player2_countdown_3);
}
else if(millisUntilFinished <= 3000 && millisUntilFinished >= 2001 )
{
cdImage.setBackgroundResource(R.drawable.player1_countdown_2);
cdImage2.setBackgroundResource(R.drawable.player2_countdown_2);
}
if (millisUntilFinished <= 2000 && millisUntilFinished >= 1000 )
{
cdImage.setBackgroundResource(R.drawable.player1_countdown_1);
cdImage2.setBackgroundResource(R.drawable.player2_countdown_1);
}
if (millisUntilFinished <= 999 && millisUntilFinished >= 0 )
{
cdImage.setBackgroundResource(R.drawable.player1_countdown_go);
cdImage2.setBackgroundResource(R.drawable.player2_countdown_go);
}
}
但我也有文件 player1_countdown_4.png player1_countdown_5.png player1_countdown_6.png
它显示了这些文件,而不是订单中的正确文件:6,5,4,go
答案 0 :(得分:4)
有时这是一个Eclipse错误。您应该尝试清理项目并查看它是否有帮助。 “项目 - &gt;清洁”