gpt4 book ai didi

java - 如何以编程方式暂停 Activity ?

转载 作者:行者123 更新时间:2023-11-29 22:26:08 30 4
gpt4 key购买 nike

如何以编程方式暂停 Activity ?我有一个通过 Intent 创建 Activity 的 TabHost:

Intent intent;  // Reusable Intent for each tab

// Create an Intent to launch an Activity for the tab (to be reused)
intent = new Intent().setClass(this, ARActivity.class);
intent.putExtras(b);

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("trending").setIndicator("Trending",res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

我希望能够在我的选项卡更改时暂停 Activity 。我怎样才能务实地暂停 Activity ?

最佳答案

如果 Activity 不在 View 中,它将始终暂停。在这里阅读 http://developer.android.com/guide/topics/fundamentals.html#actlife

关于java - 如何以编程方式暂停 Activity ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5917689/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com