마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

어플이름이(가) 중지되었습니다. 라고 뜹니다.

0 추천
//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
 
탭에 문제가 있는 것 같은데 정확히 어떤 문제인지 파악이 안되고 있네요.
여러분들의 도움을 청합니다. 감사합니다.
일월 (510 포인트) 님이 2013년 3월 13일 질문

1개의 답변

0 추천

Caused by: java.lang.OutOfMemoryError

 

라고 합니다.

관련 에러로 구글에서 검색해 보세요.

퐁풍 (8,740 포인트) 님이 2013년 3월 13일 답변
...