많은 예제, 질문 및 자습서를 읽었지만 특정 탭으로 활동 시작 (새로운 의도 시작)을 본 적이 없습니다. 그 중 하나는 .setCurrentTab
을 사용하여 탭으로 전환 할 수 있지만이 작업은 상위 작업 탭 내부에서만 수행 할 수 있습니다. 다른 활동에서 한 활동에 포함 된 특정 탭을 시작하는 방법은 어떻습니까? 가능한가? 그렇다면 어떻게?특정 탭으로 활동을 시작하는 방법은 무엇입니까?
내 코드에서 표준 활동 실행 사용자는 첫 번째 탭이 표시되지만 다른 활동에서 리디렉션되는 경우 4 번째 탭으로 이동해야합니다. 내 TabHost 코드 (MyTabActivity) : 다른 활동에서 지금
int tabIndex = 0;
mTabHost.addTab(mTabHost.newTabSpec("top10").setIndicator("Top 10").setContent(R.id.Top_10));
mTabHost.addTab(mTabHost.newTabSpec("billable").setIndicator("Billable").setContent(R.id.Billable));
mTabHost.addTab(mTabHost.newTabSpec("product").setIndicator("Product").setContent(R.id.Product));
mTabHost.addTab(mTabHost.newTabSpec("regular").setIndicator("Regular").setContent(R.id.General));
mTabHost.setCurrentTab(tabIndex);
는 :
public void gotoTab() {
//This will take me to the first tab
Intent i = new Intent(this, MyTabActivity.class);
startActivity(i);
finish();
//How to I make it take me to the fourth tab?
}