我如何以编程方式暂停活动?我有一个通过Intent创建活动的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);
我希望选项卡更改时能够暂停活动。如何实用地暂停活动?
如果看不到活动,则该活动将始终被暂停。在这里阅读http://developer.android.com/guide/topics/fundamentals.html#actlife