해결 방법 : 'adb shell dumpsys activity'가 TabActivity에서 작동하지 않습니다. 각 탭 항목을 선택하면 해당 활동이 시작됩니다. 그러나 'adb shell dumpsys activity'를 사용하면 항상 'main'활동을 반환합니다.
public class main extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.e("xyz", "start main...............");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost = getTabHost(); // The activity TabHost
TabHost.TabSpec spec; // Resusable TabSpec for each tab
Intent intent; // Reusable Intent for each tab
// Create an Intent to launch an Activity for the tab (to be reused)
intent = new Intent().setClass(this, widgets.class);
spec = tabHost.newTabSpec("Widgets").setIndicator("Widgets", res.getDrawable(R.drawable.tab1)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, layouts.class);
spec = tabHost.newTabSpec("Layouts").setIndicator("Layouts",res.getDrawable(R.drawable.tab2)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, composite1.class);
spec = tabHost.newTabSpec("Composite").setIndicator("Composite",res.getDrawable(R.drawable.tab3)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, imageMedia.class);
spec = tabHost.newTabSpec("Image_Media").setIndicator("Image&Media",res.getDrawable(R.drawable.tab4)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, timeDate.class);
spec = tabHost.newTabSpec("Time_Date").setIndicator("Time&Date",res.getDrawable(R.drawable.tab5)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, transitions.class);
spec = tabHost.newTabSpec("Transitions").setIndicator("Transitions",res.getDrawable(R.drawable.tab6)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, advanced.class);
spec = tabHost.newTabSpec("Advanced").setIndicator("Advanced",res.getDrawable(R.drawable.tab7)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, others.class);
spec = tabHost.newTabSpec("Others").setIndicator("Others",res.getDrawable(R.drawable.tab8)).setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, Dynamic.class);
spec = tabHost.newTabSpec("Dynamic").setIndicator("Dynamic",res.getDrawable(R.drawable.tab2)).setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(0);
}
}