【发布时间】:2014-12-03 23:13:23
【问题描述】:
我有不同的级别类,我从一个函数中调用它们。 问题是有时 Endscreen.Class 没有关闭...但它只发生在 Level5 及以上。
我在 Endscreen.class 中的函数:
public void NextLevel(View v){
switch(currentLevel){
case 1:
Intent nLvl1 = new Intent (this, Level2.class);
startActivity(nLvl1);
finish ();
break;
case 2:
Intent nLvl2 = new Intent (this, Level3.class);
startActivity(nLvl2);
finish ();
break;
case 3:
Intent nLvl3 = new Intent (this, Level4.class);
startActivity(nLvl3);
finish ();
break;
case 4:
Intent nLvl4 = new Intent (this, Level5.class);
startActivity(nLvl4);
finish ();
break;
case 5:
Intent nLvl5 = new Intent (this, Level6.class);
startActivity(nLvl5);
finish ();
break;
case 6:
Intent nLvl6 = new Intent (this, Level7.class);
startActivity(nLvl6);
finish ();
break;
case 7:
Intent nLvl7 = new Intent (this, Level8.class);
startActivity(nLvl7);
finish ();
break;
case 8:
Intent nLvl8 = new Intent (this, Level9.class);
startActivity(nLvl8);
finish ();
break;
case 9:
Intent nLvl9 = new Intent (this, LevelSelect.class);
startActivity(nLvl9);
finish ();
break;
}
}
【问题讨论】: