estoy tratando de agregar tabhost dentro de un fragmento, pero no importa lo que intento, no puedo insertarlo. Me pueden estar perdiendo algunos fundamentos aquí. Aquí está el código de mi clase TabFragment. Lo cual devuelve una vista.cómo agregar tabhost en fragmentos
public class TabFragment extends Fragment{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
private TabHost mTabHost;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.tabmain, container, false);
mTabHost = (TabHost) view.findViewById(android.R.id.tabhost);
mTabHost.setup();//very important to call this
TabHost.TabSpec tab = mTabHost.newTabSpec("my tab content");
tab.setIndicator("my tab content");
mTabHost.addTab(tab);
return view;
}
}
http://android.codeandmagic.org/2011/07/android-tabs-with-fragments/ Este enlace puede ser útil – Triode
no, no lo hace. están usando fragmentos para hacer pestañas y no es mi requerimiento más uno de mi fragmento tiene que b estático. Necesito insertar el tabhost de alguna manera – sohil
@sohil te solucionó ... estoy atrapado en el mismo ... puedes ayudar ... revisa aquí http://stackoverflow.com/questions/28106944/how-to-add-tabhost- with-navigation-drawer? noredirect = 1 # comment44592501_28106944? –