¿Por qué resalta el eclipse en R.id.tabhost?
Estoy tratando de implementar una pestaña en mi aplicación, pero el tabhost id está siendo resaltado, ¿por qué?
Cada tutorial que veo tiene TabHost tabs = (TabHost) findViewById (R.id.tabhost) , y cada vez que incluyo esta línea, tabhost se hightlighted, con error: tabhost no se puede resolver o no es un campo .
- Mostrar iconos en las fichas FragmentPagerAdapter
- Número de pestañas en ActionBar
- Android FragmentTabHost: Excepción generada durante la renderización: No se conoce ninguna pestaña null
- La tecla Tab no funciona en Android Studio
- Cómo cambiar las pestañas de forma programática mediante buttonclick en Android
recipe_list.java:
TabHost tabs=(TabHost)findViewById(R.id.tabhost); tabs.setup(); TabHost.TabSpec spec=tabs.newTabSpec("tag1"); spec.setContent(R.id.tab1); spec.setIndicator("Clock"); tabs.addTab(spec); spec=tabs.newTabSpec("tag2"); spec.setContent(R.id.tab2); spec.setIndicator("Button"); tabs.addTab(spec);
recipe_list.xml , tengo vistas de lista en cada pestaña:
<TabHost android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TabWidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" > </TabWidget> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/tab1" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@+id/listView1" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_weight="1" > </ListView> </LinearLayout> <LinearLayout android:id="@+id/tab2" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@+id/listView2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" > </ListView> </LinearLayout> <LinearLayout android:id="@+id/tab3" android:layout_width="match_parent" android:layout_height="match_parent" > </LinearLayout> </FrameLayout> </LinearLayout> </TabHost>
- Añadir imagen en 3 pestañas
- ¿Es posible comprobar si una "TAB" específica en TabWidget está visible en la vista actual o no?
- Android: Google Play como pestañas
- ¿Por qué obtengo un error al intentar establecer el contenido de un tabspec en android?
- Configuración de la TAB seleccionada con un pequeño triángulo debajo de ella
- Asignación de fragmentos a las pestañas de la barra de acciones con diferentes orientaciones
- Pestaña simple que utiliza fragmentactivity en lugar de tabactivity
- Creación de botones de pestaña personalizados
TabHost tabs=(TabHost)findViewById(android.R.id.tabhost);
o
TabHost tabs=getTabHost();
- GCM push notifications – Necesita ver todas las alertas push en el área de notificación móvil, una tras otra.
- Cambiar el idioma de la aplicación en android 5.0 no funciona