开发者

How to programmatically pause an activity?

开发者 https://www.devze.com 2023-03-04 12:15 出处:网络
How can I programmatically pause an activity? I have a TabHost that is creating an activity through an Intent:

How can I programmatically pause an activity? I have a TabHost that is creating an activity through an Intent:

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);

I want to be able to pause the activity when my tab changes. How can I pragmatically开发者_如何转开发 pause an activity?


Activity will always be paused if it is not in view. Read here http://developer.android.com/guide/topics/fundamentals.html#actlife

0

精彩评论

暂无评论...
验证码 换一张
取 消