//T_Custom_Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.t_sub0);
Log.i("msg","check-");
res = getResources();
tabHost = getTabHost();
intent = new Intent().setClass(this, MainActivity.class);
spec = tabHost.newTabSpec("tab_1").setIndicator(
new MyTabView(this, "1번탭"))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, UsingMainActivity.class);
spec = tabHost.newTabSpec("tab_2").setIndicator(
new MyTabView(this, "2번탭"))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, PriceMainActivity.class);
spec = tabHost.newTabSpec("tab_3").setIndicator(
new MyTabView(this, "3번탭"))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, Tale_1_Main_Activity.class);
spec = tabHost.newTabSpec("tab_4").setIndicator(
new MyTabView(this, "4번탭"))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, CalcMainActivity.class);
spec = tabHost.newTabSpec("tab_5").setIndicator(
new MyTabView(this, "5번탭"))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, CustomMainActivity.class);
spec = tabHost.newTabSpec("tab_6").setIndicator(
new MyTabView(this, "6번탭"))
.setContent(intent);
tabHost.addTab(spec);
Log.i("msg","check--");
tabHost.setCurrentTab(5);
Log.i("msg","check--!");
tabHost.setOnTabChangedListener(this);
Log.i("msg","check--!!");
for(int i = 0; i < tabHost.getTabWidget().getChildCount(); i++)
{
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 50;
}
Log.i("msg","check---");
}
위의 소스중에서 .tabHost.setCurrentTab(5); 를 주석으로 처리하면 실행은 되지만
다른 탭화면으로 넘어가지가 않습니다.
로그캣은 다음과 같이 뜹니다.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidbook.brotherflower/com.androidbook.brotherflower.T_Custom_Activity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidbook.brotherflower/com.androidbook.brotherflower.CustomMainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidbook.brotherflower/com.androidbook.brotherflower.CustomMainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.OutOfMemoryError
탭에 문제가 있는 것 같은데 정확히 어떤 문제인지 파악이 안되고 있네요.
여러분들의 도움을 청합니다. 감사합니다.