Tabhost setup() not working

1.5k Views Asked by At

I follow the tutorial in android documentation how to use Tabhost within Fragment, But I'm getting always

The method setup(android.content.Context, android.support.v4.app.FragmentManager, int) in the type FragmentTabHost is not applicable for the arguments (android.content.Context, android.app.FragmentManager, int)

My setup command is like this:

mTabHost.setup( getActivity().getApplicationContext(), getChildFragmentManager(), R.layout.fragment_vc_view);
1

There are 1 best solutions below

2
On

Sounds like your class in which you call the setup method extends android.app.Fragment and not android.support.v4.app.Fragment.