【问题标题】:Tabhost setup() not working选项卡主机设置()不起作用
【发布时间】:2013-12-14 18:23:47
【问题描述】:

我按照 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)

我的设置命令是这样的:

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

【问题讨论】:

    标签: android android-tabhost fragment-tab-host


    【解决方案1】:

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

    【讨论】:

    • 那么我需要改变什么?
    • 将 import android.app.Fragment 改为 import android.support.v4.app.Fragment
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-23
    • 2013-02-03
    • 2020-02-15
    相关资源
    最近更新 更多