0

Android アプリの作成方法を学んでいますが、このエラーに悩まされており、理解できません。

これは私のxmlファイルにあるものです:

<LinearLayout
android:id="@+id/tab1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

そして、私が問題を抱えているコードの部分は次のとおりです。

Resources res = getResources();

tabs = (TabHost)findViewById(android.R.id.tabhost);
tabs.setup();

TabHost.TabSpec spec = tabs.newTabSpec("mitab1");
spec.setContent(R.id.tab1);
spec.setIndicator("",res.getDrawable(android.R.drawable.ic_menu_my_calendar));
tabs.addTab(spec);

spec.setContent(R.id.tab1) 行に次のエラーが表示されます: シンボルが見つかりません: 変数 ID。

私は何を間違っていますか?どんな助けでも大歓迎です。

4

2 に答える 2