开发者

on tab click run oncreate() method of corresponding class android

i have 4 tabs in my same view i want to that when i chnge the tabs and load it again it always run its oncreate() method of corresponding class...each time when i change the tab it runs it's called class.i have a problem with this bcoz tab click event load its view in first time when i click on it then again if i changing the tab it's only load it again not run its oncreate() method so how to over come this problem ...

i had also used....

intent1 = new Intent().setClass(this, keywordxmlparsing.class);
spec1 = tabHo开发者_开发知识库st.newTabSpec("Activity2").setIndicator("keyword search...").setContent(intent1);
tabHost.addTab(spec1); 

@Override
public void onTabChanged(String label) {
    // TODO Auto-generated method stub
    if(label == "Activity2") {

           Variables.a=2;


    }
    try{
    if(label == "Activity4") {


    }

so on tab change how to run its corresponding class again when i push tab again??? thanks in adv. to all my response-rs..


put your code in OnResume() methods,it may help you

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜