У меня возникла проблема с отображением вида на tabhost - когда я выбираю вкладку, содержимое остается пустым.
Из того, что я могу сказать, onCreateView
не вызывается на дочерних фрагментах. onMenuCreate
работает нормально, потому что меню изменяется так, как предполагается.
public class PatientTabFragment extends Fragment {
private FragmentTabHost mTabHost;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mTabHost = new FragmentTabHost(getActivity());
mTabHost.setup(getActivity(), getChildFragmentManager());
mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Info"),
NewPatientFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec("contacts").setIndicator("Notes"),
NoteListFragment.class, null);
return mTabHost;
}
@Override
public void onDestroyView() {
super.onDestroyView();
mTabHost = null;
}
}