I used below code and it is not render graphical layout. display error as Exception raised during rendering: No tab known for tag null.
how can i solve
I got a similar problem on using tabHost in fragments, searched a lot and finally found a solution to that.
1) Keep you code in on create view
2) This is the key -> While inflating the layout for tab indicators use as follows
View tabIndicator = LayoutInflater.from(getActivity()).inflate(R.layout.tab_indicator, mTabHost.getTabWidget(), false);
We need to set the parent value in the inflater as mTabHost.getTabWidget()
Setting tab indicator using the above code solved the issue of
Java : illegal state exception : no tab know for tag null
Update :
mTabHost = (FragmentTabHost) view.findViewById(android.R.id.tabhost);
mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
View tabIndicatorToday = LayoutInflater.from(getActivity()).inflate(R.layout.tab_indicator, mTabHost.getTabWidget(), false);
((TextView) tabIndicatorToday.findViewById(R.id.tv_tab_txt)).setText(getResources().getString(R.string.text));
mTabHost.addTab(mTabHost.newTabSpec(getResources().getString(R.string.text)).setIndicator(tabIndicatorToday), Fragment.class, null);