如何以编程方式暂停活动?我有一个通过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);
我希望能够在我的标签更改时暂停活动。我怎样才能务实地暂停活动?
答案 0 :(得分:1)
如果不在视图中,活动将始终暂停。阅读http://developer.android.com/guide/topics/fundamentals.html#actlife