简体   繁体   中英

the activity life cycle of the android tabhost

I am trying to use a tabhost that contains 3 tabs

I also have a button within the tabhost that can be clicked no matter what activity is in the frameLayout. (this button returns back to a previous non tab activity)

When one of my tab activites is paused it stores some information.(So every time i switch tab information is stored).

what i am having trouble with is, when i press the button, i call

TabbedActivity.this.finish();

the onPause and onStop method of the activity within the frame layout is not called.

how would i go about calling these methods before i call the .finish() method

To ensure my onPause method was called.... i just called

if(tabHost.getCurrentTab() !=0){
                tabHost.setCurrentTab(0);
            }else{
                tabHost.setCurrentTab(1);
            }


            PinMeTabbedActivity.this.finish();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM