설명서에서 해당 활동이 매니페스트에서 launchMode = "singleTop"을 설정하면 onNewIntent 콜백을 통해 의도가 표시됩니다.TabHost 내부의 활동 onNewIntent
활동이 TabHost에 의해 시작된 경우이 동작을 수행하지 못했습니다. onNewIntent를 호출하는 대신 활동의 onCreate 메소드가 호출되어 활동 스택 맨 위에 활동의 새 인스턴스가 생성됩니다.
// create the TabHost that will contain the Tabs
tabHost = (TabHost)findViewById(android.R.id.tabhost);
TabSpec tab1 = tabHost.newTabSpec("First Tab");
TabSpec tab2 = tabHost.newTabSpec("Second Tab");
TabSpec tab3 = tabHost.newTabSpec("Third tab");
// Set the Tab name and Activity
// that will be opened when particular Tab will be selected
tab1.setIndicator("Tab1");
Intent intent = new Intent(this, WhenLogin.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|
Intent.FLAG_ACTIVITY_SINGLE_TOP);
tab1.setContent(intent);
다른 사람이 문제가 있었 :
이 의도를 시작하는 내 코드는? 그렇다면 해결책을 찾았습니까?
"''TabHost'"로 시작한 것은 무엇을 의미합니까? – CommonsWare
나는 탭을 사용하고있다. 탭을 사용하지 않았을 때 모두 정상적으로 작동했습니다. –
아마 당신은 "TabHost'에 의해 시작된"의미 "를 설명하기 위해 소스 코드에 붙여 넣는 것을 고려할 수 있습니다. – CommonsWare