안드로이드 개발 질문/답변
(글 수 45,052)
package AnD.Test;
import android.app.TabActivity;
import android.os.Bundle;
import android.widget.TabHost;
public class Test extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost mTabHost = getTabHost();
mTabHost.addTab(mTabHost.newTabSpec("tab_test1")
.setIndicator("1st")
.setContent(R.id.TextView01));
mTabHost.addTab(mTabHost.newTabSpec("tab_test2")
.setIndicator("2nd")
.setContent(R.id.TextView02));
mTabHost.setCurrentTab(0);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabHost android:id="@+id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout android:id="@android:id/tabcontent"
android:layout_above="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="TextView01">
</TextView>
<TextView
android:id="@+id/TextView02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="TextView02">
</TextView>
</FrameLayout>
</RelativeLayout>
</TabHost>
</LinearLayout>
문법 적으로 에러가 난 곳은 없습니다
오류.bmp
가상머신에 위의 파일처럼
The application Test has stopped unexpectedly.
please try again
이렇게 뜨네요;;
layout에서 잘못 있는건지....
도대체가 어디가 잘못인지 잘 모르겠네요
고수님들 좀 봐주세요 ㅠ




로그캣을 안쓰시는 모양이네요.
로그캣을 봐야 디버깅을 할 수 있습니다.
여기오는사람들도 로그캣을 올려주는게 좋아요 소스보단...