如何防止在按下后退按钮时重新创建 singleTask activity?

How to prevent recreation of a singleTask activity on back button press?

我有一个简单的启动器应用程序,它不启动任何应用程序,只显示一个 WebView。它被设置为默认启动器。我不在此平板电脑上使用任何其他应用程序。当我重新启动平板电脑时,此启动器会按预期启动。我的问题是,如果我按下设备的后退按钮,activity 会被破坏,并且会重新创建为新的 activity。我不明白这种行为有什么意义,因为 activity 已经可见...视图的启动模式是 singleTask,所以我希望它只是停留在原处,而不是重新创建。如何才能做到这一点?据我对文档的理解,这应该会像我预期的那样工作,而不是现在的方式。

The system creates the activity at the root of a new task and routes the intent to it. However, if an instance of the activity already exists, the system routes the intent to existing instance through a call to its onNewIntent() method, rather than creating a new one. http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

您可以重写 onBackPressed() 并且什么都不做

@Override
public void onBackPressed() { }