I am new to android development,I used navigation drawer from this http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
Now I want to a
You not added any view for your TabHost View. Try to add view in your setIndicator()
method like this.
public class HomeFragment extends Fragment {
private FragmentTabHost mTabHost;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mTabHost = new FragmentTabHost(getActivity());
mTabHost.setup(getActivity(), getChildFragmentManager(),
R.layout.fragment_home);
Bundle arg1 = new Bundle();
arg1.putInt("Arg for Frag1", 1);
View view = LayoutInflater.from(getActivity()).inflate(
R.layout.yourview1, null);
mTabHost.addTab(mTabHost.newTabSpec("Tab1").setIndicator(view),
PhotosActivity.class, arg1);
Bundle arg2 = new Bundle();
arg2.putInt("Arg for Frag2", 2);
View view = LayoutInflater.from(getActivity()).inflate(
R.layout.yourview2, null);
mTabHost.addTab(mTabHost.newTabSpec("Tab2").setIndicator(view),
PhotosActivity.class, arg2);
return mTabHost;
}
@Override
public void onDestroyView() {
super.onDestroyView();
mTabHost = null;
}