mHandler.removeMessages(TIME_CHANGED); 为什么要加上这一句,不是很明白,为什么在第二关的时候,时间会加速了?
/**
* 判断用户游戏是都成功
*/
private void checkSuccess()
{
boolean isSuccess = true;
for (int i = 0; i < mGamePintuItems.length; i++)
{
ImageView imageView = mGamePintuItems[i];
if (getImageIndexByTag1((String) imageView.getTag()) != i)
{
isSuccess = false;
}
}
if (isSuccess)
{
isGameSuccess = true;
mHandler.removeMessages(TIME_CHANGED);
Toast.makeText(getContext(), "Success level up !!!",
Toast.LENGTH_LONG).show();
mHandler.sendEmptyMessage(NEXT_LEVEL);
}
}