问题:可以说我有3个活动:MainMenu,LevelSelection和Game。我有一个按钮在MainMenu中运行一个意图,将玩家重定向到LevelSelection。在LevelSelection中是另一个将玩家重定向到游戏的按钮。当活动游戏结束时,它运行一个意图将玩家重定向到MainMenu活动。但是,在测试时,重定向将完成到LevelSelection而不是MainMenu。重定向到有意向活动的问题
的MainMenu => LevelSelection代码
this.finish();
Intent intent = new Intent(this, LevelSelection.class);
this.startActivity(intent);
LevelSelection =>游戏代码
this.finish();
Intent intent = new Intent(this, Game.class);
this.startActivity(intent);
游戏=> MeainMenu代码
this.finish();
Intent intent = new Intent(this, MainMenu.class);
this.startActivity(intent);
提前致谢。
这将特别解决这个问题。然而,这个应用程序比3个活动更复杂,我想知道为什么会发生这种行为。谢谢! – CapitanNerd