Tabhost设置()不起作用

the*_*heo 1 android android-tabhost fragment-tab-host

我按照Android文档中的教程如何在Fragment中使用Tabhost,但我总是得到

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)
Run Code Online (Sandbox Code Playgroud)

我的设置命令是这样的:

mTabHost.setup( getActivity().getApplicationContext(), getChildFragmentManager(), R.layout.fragment_vc_view);
Run Code Online (Sandbox Code Playgroud)

Tep*_*ian 9

听起来像你的类调用setup方法android.app.Fragment而不是android.support.v4.app.Fragment.