안드로이드 개발 질문/답변
(글 수 45,052)
public class sworld extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TabHost tabH = getTabHost();
tabH.addTab(tabH.newTabSpec("tab1")
.setIndicator("Home")
.setContent(new Intent(this,home.class))
);
tabH.addTab(tabH.newTabSpec("tab2")
.setIndicator("Sworld")
.setContent(new Intent(this,sview.class))
);
tabH.addTab(tabH.newTabSpec("tab3")
.setIndicator("myInfo")
.setContent(new Intent(this,myInfo.class))
);
}
}
이렇게 시작을 하면 tab1 인 class home 이 보여집니다.
tab2 가 먼저 보여지게 하려면 어떻게 해야할까요..
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TabHost tabH = getTabHost();
tabH.addTab(tabH.newTabSpec("tab1")
.setIndicator("Home")
.setContent(new Intent(this,home.class))
);
tabH.addTab(tabH.newTabSpec("tab2")
.setIndicator("Sworld")
.setContent(new Intent(this,sview.class))
);
tabH.addTab(tabH.newTabSpec("tab3")
.setIndicator("myInfo")
.setContent(new Intent(this,myInfo.class))
);
}
}
이렇게 시작을 하면 tab1 인 class home 이 보여집니다.
tab2 가 먼저 보여지게 하려면 어떻게 해야할까요..
public void setDefaultTab (String tag)